Skip to content

Commit

Permalink
Changed custom output map name.
Browse files Browse the repository at this point in the history
  • Loading branch information
OliverLok committed Dec 3, 2024
1 parent 4f916de commit 0b206e8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions cmd/call-api-endpoint/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ func main() {

var printFunc cmd.CustomResponseFormatter
if args.Table {
printFunc = cmd.CUSTOM_OUTPUT_MAP[args.Endpoint]
printFunc = cmd.EndpointCustomFormatters[args.Endpoint]
if printFunc == nil {
log.Fatal("Table formatting is not supported for the specified endpoint.", log.NewAttr("endpoint", args.Endpoint))

Expand All @@ -93,7 +93,7 @@ func generateHelpDescription() string {
var customOutputEndpointList strings.Builder
customOutputEndpointList.WriteString("Endpoints supporting TSV formatting:\n")

for endpoint := range cmd.CUSTOM_OUTPUT_MAP {
for endpoint := range cmd.EndpointCustomFormatters {
customOutputEndpointList.WriteString(fmt.Sprintf(" - %s\n", endpoint))
}

Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/custom_output.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"github.com/edulinq/autograder/internal/util"
)

var CUSTOM_OUTPUT_MAP = map[string]CustomResponseFormatter{
var EndpointCustomFormatters = map[string]CustomResponseFormatter{
"users/list": mustListServerUsersTable,
"courses/users/list": mustListCourseUsersTable,
}
Expand Down

0 comments on commit 0b206e8

Please sign in to comment.