From 3e8f62fe4274e606fdb2362070a834b1249a9311 Mon Sep 17 00:00:00 2001 From: Antoine Pelisse Date: Mon, 12 Jun 2023 13:19:02 -0700 Subject: [PATCH] generators: Simplify backtick escape in test --- pkg/generators/openapi_test.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/pkg/generators/openapi_test.go b/pkg/generators/openapi_test.go index c5d424d83..ba86a17a9 100644 --- a/pkg/generators/openapi_test.go +++ b/pkg/generators/openapi_test.go @@ -1632,10 +1632,10 @@ const EnumB EnumType = "b" // +k8s:openapi-gen=true // +k8s:openapi-gen=x-kubernetes-type-tag:type_test type Blah struct { - // Value is the value. + // Value is the value. Value EnumType NoCommentEnum EnumType - // +optional + // +optional OptionalEnum *EnumType }`) if callErr != nil { @@ -1653,8 +1653,8 @@ Description: "Blah is a test.", Type: []string{"object"}, Properties: map[string]spec.Schema{ "Value": { -SchemaProps: spec.SchemaProps{`+"\n"+ - "Description: \"Value is the value.\\n\\nPossible enum values:\\n - `\\\"a\\\"` is a.\\n - `\\\"b\\\"` is b.\","+` +SchemaProps: spec.SchemaProps{ +Description: "Value is the value.\n\nPossible enum values:\n - `+"`"+`\"a\"`+"`"+` is a.\n - `+"`"+`\"b\"`+"`"+` is b.", Default: "", Type: []string{"string"}, Format: "", @@ -1662,8 +1662,8 @@ Enum: []interface{}{"a", "b"}, }, }, "NoCommentEnum": { -SchemaProps: spec.SchemaProps{`+"\n"+ - "Description: \"Possible enum values:\\n - `\\\"a\\\"` is a.\\n - `\\\"b\\\"` is b.\","+` +SchemaProps: spec.SchemaProps{ +Description: "Possible enum values:\n - `+"`"+`\"a\"`+"`"+` is a.\n - `+"`"+`\"b\"`+"`"+` is b.", Default: "", Type: []string{"string"}, Format: "", @@ -1671,8 +1671,8 @@ Enum: []interface{}{"a", "b"}, }, }, "OptionalEnum": { -SchemaProps: spec.SchemaProps{`+"\n"+ - "Description: \"Possible enum values:\\n - `\\\"a\\\"` is a.\\n - `\\\"b\\\"` is b.\","+` +SchemaProps: spec.SchemaProps{ +Description: "Possible enum values:\n - `+"`"+`\"a\"`+"`"+` is a.\n - `+"`"+`\"b\"`+"`"+` is b.", Type: []string{"string"}, Format: "", Enum: []interface{}{"a", "b"},