Skip to content

Commit

Permalink
Fix errors reported by the new golangci-lint version
Browse files Browse the repository at this point in the history
  • Loading branch information
kklimonda-cl committed Aug 16, 2024
1 parent cdaed09 commit a4e219a
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
32 changes: 16 additions & 16 deletions pkg/properties/normalized.go
Original file line number Diff line number Diff line change
Expand Up @@ -329,11 +329,11 @@ func schemaParameterToSpecParameter(schemaSpec *parameter.Parameter) (*SpecParam
for _, v := range schemaSpec.Validators {
switch spec := v.Spec.(type) {
case *validator.CountSpec:
min := int64(spec.Min)
max := int64(spec.Max)
minValue := int64(spec.Min)
maxValue := int64(spec.Max)
itemsSpec.Length = &SpecParamItemsLength{
Min: &min,
Max: &max,
Min: &minValue,
Max: &maxValue,
}
}
}
Expand Down Expand Up @@ -393,18 +393,18 @@ func schemaParameterToSpecParameter(schemaSpec *parameter.Parameter) (*SpecParam
case *validator.RegexpSpec:
specParameter.Regex = spec.Expr
case *validator.StringLengthSpec:
min := int64(spec.Min)
max := int64(spec.Max)
minValue := int64(spec.Min)
maxValue := int64(spec.Max)
specParameter.Length = &SpecParamLength{
Min: &min,
Max: &max,
Min: &minValue,
Max: &maxValue,
}
case *validator.CountSpec:
min := int64(spec.Min)
max := int64(spec.Max)
minValue := int64(spec.Min)
maxValue := int64(spec.Max)
specParameter.Count = &SpecParamCount{
Min: &min,
Max: &max,
Min: &minValue,
Max: &maxValue,
}
}
}
Expand Down Expand Up @@ -547,11 +547,11 @@ func schemaToSpec(object object.Object) (*Normalization, error) {
for _, v := range entry.Validators {
switch spec := v.Spec.(type) {
case *validator.StringLengthSpec:
min := int64(spec.Min)
max := int64(spec.Max)
minValue := int64(spec.Min)
maxValue := int64(spec.Max)
specEntry.Name.Length = &EntryNameLength{
Min: &min,
Max: &max,
Min: &minValue,
Max: &maxValue,
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/translate/structs.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ func calculateNestedXmlSpecType(parent string, param *properties.SpecParam) stri

// XmlName creates a string with xml name (e.g. `description`).
func XmlName(param *properties.SpecParam) string {
if param.Profiles != nil && len(param.Profiles) > 0 {
if len(param.Profiles) > 0 {
return strings.Join(param.Profiles[0].Xpath, ">")
}

Expand All @@ -141,7 +141,7 @@ func XmlName(param *properties.SpecParam) string {

// XmlTag creates a string with xml tag (e.g. `xml:"description,omitempty"`).
func XmlTag(param *properties.SpecParam) string {
if param.Profiles != nil && len(param.Profiles) > 0 {
if len(param.Profiles) > 0 {
suffix := ""

if param.Name != nil && (param.Name.Underscore == "uuid" || param.Name.Underscore == "name") {
Expand Down

0 comments on commit a4e219a

Please sign in to comment.