File tree Expand file tree Collapse file tree 1 file changed +2
-5
lines changed
v1/providers/launchpad/scripts/finalize-swagger Expand file tree Collapse file tree 1 file changed +2
-5
lines changed Original file line number Diff line number Diff line change @@ -127,10 +127,7 @@ func buildEnumVarnames(nodeName string, enumNode *yaml.Node) []*yaml.Node {
127127 }
128128
129129 // Use the enum node name as the prefix for the enum values (removing the "Enum" suffix if it exists)
130- prefix := nodeName
131- if strings .HasSuffix (prefix , "Enum" ) {
132- prefix = prefix [:len (prefix )- 4 ]
133- }
130+ prefix := strings .TrimSuffix (nodeName , "Enum" )
134131
135132 // Create the enum nodes
136133 enumNodes := make ([]* yaml.Node , 0 , len (enumValues ))
@@ -285,7 +282,7 @@ func AddOneOfEntries(yamlNode *yaml.Node) error { //nolint:gocyclo // readabilit
285282 }
286283
287284 var oneOfNode * yaml.Node
288- if nodeType .Value == "string" {
285+ if nodeType .Value == "string" { //nolint:staticcheck // if statement is preferable
289286 // If the node is a string, convert it to a oneOf entry
290287 oneOfNode = convertStringToOneOf (key , val )
291288 } else if nodeType .Value == "array" {
You can’t perform that action at this time.
0 commit comments