Skip to content

Commit ad16b3b

Browse files
committed
lint
1 parent 93f0792 commit ad16b3b

File tree

1 file changed

+2
-5
lines changed
  • v1/providers/launchpad/scripts/finalize-swagger

1 file changed

+2
-5
lines changed

v1/providers/launchpad/scripts/finalize-swagger/main.go

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff 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" {

0 commit comments

Comments
 (0)