From 0b206e8b8e7191c3f7dc3fba4d1a5518bc923416 Mon Sep 17 00:00:00 2001 From: Oliver Date: Mon, 2 Dec 2024 20:22:42 -0800 Subject: [PATCH] Changed custom output map name. --- cmd/call-api-endpoint/main.go | 4 ++-- internal/cmd/custom_output.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cmd/call-api-endpoint/main.go b/cmd/call-api-endpoint/main.go index 4a18880f..8c0183a5 100644 --- a/cmd/call-api-endpoint/main.go +++ b/cmd/call-api-endpoint/main.go @@ -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)) @@ -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)) } diff --git a/internal/cmd/custom_output.go b/internal/cmd/custom_output.go index 61573a02..ec6c54b2 100644 --- a/internal/cmd/custom_output.go +++ b/internal/cmd/custom_output.go @@ -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, }