diff --git a/shared/api/status_code.go b/shared/api/status_code.go index cc9f83f57607..0331c7651ec1 100644 --- a/shared/api/status_code.go +++ b/shared/api/status_code.go @@ -69,8 +69,8 @@ func StatusCodeFromString(status string) StatusCode { } // GetAllStatusCodeStrings returns a slice of all status code strings. -func GetAllStatusCodeStrings() []string { - var statusStrings []string +func GetAllStatusCodeStrings() (statusStrings []string) { + statusStrings = make([]string, 0, len(StatusCodeNames)) for _, code := range StatusCodeNames { statusStrings = append(statusStrings, code) }