diff --git a/modules/openapi-generator/src/main/resources/go/client.mustache b/modules/openapi-generator/src/main/resources/go/client.mustache index 616772c8891..06d61f88666 100644 --- a/modules/openapi-generator/src/main/resources/go/client.mustache +++ b/modules/openapi-generator/src/main/resources/go/client.mustache @@ -712,5 +712,5 @@ func formatErrorMessage(status string, v interface{}) string { } // status title (detail) - return fmt.Sprintf("%s %s", status, str) + return strings.TrimSpace(fmt.Sprintf("%s %s", status, str)) } diff --git a/samples/client/petstore/go/go-petstore/client.go b/samples/client/petstore/go/go-petstore/client.go index 68b58dc81f1..4cca0669400 100644 --- a/samples/client/petstore/go/go-petstore/client.go +++ b/samples/client/petstore/go/go-petstore/client.go @@ -672,5 +672,5 @@ func formatErrorMessage(status string, v interface{}) string { } // status title (detail) - return fmt.Sprintf("%s %s", status, str) + return strings.TrimSpace(fmt.Sprintf("%s %s", status, str)) } diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/go-experimental/client.go b/samples/openapi3/client/extensions/x-auth-id-alias/go-experimental/client.go index 3a48f969830..b641ac83f2e 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/go-experimental/client.go +++ b/samples/openapi3/client/extensions/x-auth-id-alias/go-experimental/client.go @@ -657,5 +657,5 @@ func formatErrorMessage(status string, v interface{}) string { } // status title (detail) - return fmt.Sprintf("%s %s", status, str) + return strings.TrimSpace(fmt.Sprintf("%s %s", status, str)) } diff --git a/samples/openapi3/client/petstore/go/go-petstore/client.go b/samples/openapi3/client/petstore/go/go-petstore/client.go index fa1714c97fb..0c80456c12d 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/client.go +++ b/samples/openapi3/client/petstore/go/go-petstore/client.go @@ -685,5 +685,5 @@ func formatErrorMessage(status string, v interface{}) string { } // status title (detail) - return fmt.Sprintf("%s %s", status, str) + return strings.TrimSpace(fmt.Sprintf("%s %s", status, str)) }