Skip to content

Commit 3e8f62f

Browse files
committed
generators: Simplify backtick escape in test
1 parent 725288a commit 3e8f62f

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

Diff for: pkg/generators/openapi_test.go

+8-8
Original file line numberDiff line numberDiff line change
@@ -1632,10 +1632,10 @@ const EnumB EnumType = "b"
16321632
// +k8s:openapi-gen=true
16331633
// +k8s:openapi-gen=x-kubernetes-type-tag:type_test
16341634
type Blah struct {
1635-
// Value is the value.
1635+
// Value is the value.
16361636
Value EnumType
16371637
NoCommentEnum EnumType
1638-
// +optional
1638+
// +optional
16391639
OptionalEnum *EnumType
16401640
}`)
16411641
if callErr != nil {
@@ -1653,26 +1653,26 @@ Description: "Blah is a test.",
16531653
Type: []string{"object"},
16541654
Properties: map[string]spec.Schema{
16551655
"Value": {
1656-
SchemaProps: spec.SchemaProps{`+"\n"+
1657-
"Description: \"Value is the value.\\n\\nPossible enum values:\\n - `\\\"a\\\"` is a.\\n - `\\\"b\\\"` is b.\","+`
1656+
SchemaProps: spec.SchemaProps{
1657+
Description: "Value is the value.\n\nPossible enum values:\n - `+"`"+`\"a\"`+"`"+` is a.\n - `+"`"+`\"b\"`+"`"+` is b.",
16581658
Default: "",
16591659
Type: []string{"string"},
16601660
Format: "",
16611661
Enum: []interface{}{"a", "b"},
16621662
},
16631663
},
16641664
"NoCommentEnum": {
1665-
SchemaProps: spec.SchemaProps{`+"\n"+
1666-
"Description: \"Possible enum values:\\n - `\\\"a\\\"` is a.\\n - `\\\"b\\\"` is b.\","+`
1665+
SchemaProps: spec.SchemaProps{
1666+
Description: "Possible enum values:\n - `+"`"+`\"a\"`+"`"+` is a.\n - `+"`"+`\"b\"`+"`"+` is b.",
16671667
Default: "",
16681668
Type: []string{"string"},
16691669
Format: "",
16701670
Enum: []interface{}{"a", "b"},
16711671
},
16721672
},
16731673
"OptionalEnum": {
1674-
SchemaProps: spec.SchemaProps{`+"\n"+
1675-
"Description: \"Possible enum values:\\n - `\\\"a\\\"` is a.\\n - `\\\"b\\\"` is b.\","+`
1674+
SchemaProps: spec.SchemaProps{
1675+
Description: "Possible enum values:\n - `+"`"+`\"a\"`+"`"+` is a.\n - `+"`"+`\"b\"`+"`"+` is b.",
16761676
Type: []string{"string"},
16771677
Format: "",
16781678
Enum: []interface{}{"a", "b"},

0 commit comments

Comments
 (0)