Skip to content

Commit

Permalink
chore: unnecessary use of fmt.Sprintf
Browse files Browse the repository at this point in the history
  • Loading branch information
testwill authored and Jefftree committed Nov 27, 2024
1 parent d47ab80 commit 8f45726
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
14 changes: 7 additions & 7 deletions openapiv2/OpenAPIv2.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ func NewAdditionalPropertiesItem(in *yaml.Node, context *compiler.Context) (*Add
// since the oneof matched one of its possibilities, discard any matching errors
errors = make([]error, 0)
} else {
message := fmt.Sprintf("contains an invalid AdditionalPropertiesItem")
message := "contains an invalid AdditionalPropertiesItem"
err := compiler.NewError(context, message)
errors = []error{err}
}
Expand Down Expand Up @@ -2543,7 +2543,7 @@ func NewNonBodyParameter(in *yaml.Node, context *compiler.Context) (*NonBodyPara
// since the oneof matched one of its possibilities, discard any matching errors
errors = make([]error, 0)
} else {
message := fmt.Sprintf("contains an invalid NonBodyParameter")
message := "contains an invalid NonBodyParameter"
err := compiler.NewError(context, message)
errors = []error{err}
}
Expand Down Expand Up @@ -3271,7 +3271,7 @@ func NewParameter(in *yaml.Node, context *compiler.Context) (*Parameter, error)
// since the oneof matched one of its possibilities, discard any matching errors
errors = make([]error, 0)
} else {
message := fmt.Sprintf("contains an invalid Parameter")
message := "contains an invalid Parameter"
err := compiler.NewError(context, message)
errors = []error{err}
}
Expand Down Expand Up @@ -3345,7 +3345,7 @@ func NewParametersItem(in *yaml.Node, context *compiler.Context) (*ParametersIte
// since the oneof matched one of its possibilities, discard any matching errors
errors = make([]error, 0)
} else {
message := fmt.Sprintf("contains an invalid ParametersItem")
message := "contains an invalid ParametersItem"
err := compiler.NewError(context, message)
errors = []error{err}
}
Expand Down Expand Up @@ -4561,7 +4561,7 @@ func NewResponseValue(in *yaml.Node, context *compiler.Context) (*ResponseValue,
// since the oneof matched one of its possibilities, discard any matching errors
errors = make([]error, 0)
} else {
message := fmt.Sprintf("contains an invalid ResponseValue")
message := "contains an invalid ResponseValue"
err := compiler.NewError(context, message)
errors = []error{err}
}
Expand Down Expand Up @@ -5030,7 +5030,7 @@ func NewSchemaItem(in *yaml.Node, context *compiler.Context) (*SchemaItem, error
// since the oneof matched one of its possibilities, discard any matching errors
errors = make([]error, 0)
} else {
message := fmt.Sprintf("contains an invalid SchemaItem")
message := "contains an invalid SchemaItem"
err := compiler.NewError(context, message)
errors = []error{err}
}
Expand Down Expand Up @@ -5160,7 +5160,7 @@ func NewSecurityDefinitionsItem(in *yaml.Node, context *compiler.Context) (*Secu
// since the oneof matched one of its possibilities, discard any matching errors
errors = make([]error, 0)
} else {
message := fmt.Sprintf("contains an invalid SecurityDefinitionsItem")
message := "contains an invalid SecurityDefinitionsItem"
err := compiler.NewError(context, message)
errors = []error{err}
}
Expand Down
22 changes: 11 additions & 11 deletions openapiv3/OpenAPIv3.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ func NewAdditionalPropertiesItem(in *yaml.Node, context *compiler.Context) (*Add
// since the oneof matched one of its possibilities, discard any matching errors
errors = make([]error, 0)
} else {
message := fmt.Sprintf("contains an invalid AdditionalPropertiesItem")
message := "contains an invalid AdditionalPropertiesItem"
err := compiler.NewError(context, message)
errors = []error{err}
}
Expand Down Expand Up @@ -113,7 +113,7 @@ func NewAnyOrExpression(in *yaml.Node, context *compiler.Context) (*AnyOrExpress
// since the oneof matched one of its possibilities, discard any matching errors
errors = make([]error, 0)
} else {
message := fmt.Sprintf("contains an invalid AnyOrExpression")
message := "contains an invalid AnyOrExpression"
err := compiler.NewError(context, message)
errors = []error{err}
}
Expand Down Expand Up @@ -227,7 +227,7 @@ func NewCallbackOrReference(in *yaml.Node, context *compiler.Context) (*Callback
// since the oneof matched one of its possibilities, discard any matching errors
errors = make([]error, 0)
} else {
message := fmt.Sprintf("contains an invalid CallbackOrReference")
message := "contains an invalid CallbackOrReference"
err := compiler.NewError(context, message)
errors = []error{err}
}
Expand Down Expand Up @@ -979,7 +979,7 @@ func NewExampleOrReference(in *yaml.Node, context *compiler.Context) (*ExampleOr
// since the oneof matched one of its possibilities, discard any matching errors
errors = make([]error, 0)
} else {
message := fmt.Sprintf("contains an invalid ExampleOrReference")
message := "contains an invalid ExampleOrReference"
err := compiler.NewError(context, message)
errors = []error{err}
}
Expand Down Expand Up @@ -1320,7 +1320,7 @@ func NewHeaderOrReference(in *yaml.Node, context *compiler.Context) (*HeaderOrRe
// since the oneof matched one of its possibilities, discard any matching errors
errors = make([]error, 0)
} else {
message := fmt.Sprintf("contains an invalid HeaderOrReference")
message := "contains an invalid HeaderOrReference"
err := compiler.NewError(context, message)
errors = []error{err}
}
Expand Down Expand Up @@ -1713,7 +1713,7 @@ func NewLinkOrReference(in *yaml.Node, context *compiler.Context) (*LinkOrRefere
// since the oneof matched one of its possibilities, discard any matching errors
errors = make([]error, 0)
} else {
message := fmt.Sprintf("contains an invalid LinkOrReference")
message := "contains an invalid LinkOrReference"
err := compiler.NewError(context, message)
errors = []error{err}
}
Expand Down Expand Up @@ -3090,7 +3090,7 @@ func NewParameterOrReference(in *yaml.Node, context *compiler.Context) (*Paramet
// since the oneof matched one of its possibilities, discard any matching errors
errors = make([]error, 0)
} else {
message := fmt.Sprintf("contains an invalid ParameterOrReference")
message := "contains an invalid ParameterOrReference"
err := compiler.NewError(context, message)
errors = []error{err}
}
Expand Down Expand Up @@ -3606,7 +3606,7 @@ func NewRequestBodyOrReference(in *yaml.Node, context *compiler.Context) (*Reque
// since the oneof matched one of its possibilities, discard any matching errors
errors = make([]error, 0)
} else {
message := fmt.Sprintf("contains an invalid RequestBodyOrReference")
message := "contains an invalid RequestBodyOrReference"
err := compiler.NewError(context, message)
errors = []error{err}
}
Expand Down Expand Up @@ -3743,7 +3743,7 @@ func NewResponseOrReference(in *yaml.Node, context *compiler.Context) (*Response
// since the oneof matched one of its possibilities, discard any matching errors
errors = make([]error, 0)
} else {
message := fmt.Sprintf("contains an invalid ResponseOrReference")
message := "contains an invalid ResponseOrReference"
err := compiler.NewError(context, message)
errors = []error{err}
}
Expand Down Expand Up @@ -4310,7 +4310,7 @@ func NewSchemaOrReference(in *yaml.Node, context *compiler.Context) (*SchemaOrRe
// since the oneof matched one of its possibilities, discard any matching errors
errors = make([]error, 0)
} else {
message := fmt.Sprintf("contains an invalid SchemaOrReference")
message := "contains an invalid SchemaOrReference"
err := compiler.NewError(context, message)
errors = []error{err}
}
Expand Down Expand Up @@ -4543,7 +4543,7 @@ func NewSecuritySchemeOrReference(in *yaml.Node, context *compiler.Context) (*Se
// since the oneof matched one of its possibilities, discard any matching errors
errors = make([]error, 0)
} else {
message := fmt.Sprintf("contains an invalid SecuritySchemeOrReference")
message := "contains an invalid SecuritySchemeOrReference"
err := compiler.NewError(context, message)
errors = []error{err}
}
Expand Down

0 comments on commit 8f45726

Please sign in to comment.