Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ linters:
- gomodguard_v2
- godox
- exhaustruct
- exhaustruct_v5
- nlreturn
- nonamedreturns
- noinlineerr
Expand Down
3 changes: 2 additions & 1 deletion default.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ func IsHostname(str string) bool {
}

// IDNA check
str, _ = strings.CutSuffix(str, ".") // tolerates trailing ".", whereas IDNA ValidateLabel rule does not
res, err := idnaHostChecker.ToASCII(strings.ToLower(str))
if err != nil || res == "" {
return false
Expand Down Expand Up @@ -1976,7 +1977,7 @@ func isISBN(str string, version int) bool {
for i = range isbnVersion13 - 1 {
checksum += factor[i%2] * int32(sanitized[i]-'0')
}
return (int32(sanitized[isbnVersion13-1]-'0'))-((decimalBase-(checksum%decimalBase))%decimalBase) == 0
return int32(sanitized[isbnVersion13-1]-'0')-((decimalBase-(checksum%decimalBase))%decimalBase) == 0
default:
return isISBN(str, isbnVersion10) || isISBN(str, isbnVersion13)
}
Expand Down
6 changes: 3 additions & 3 deletions format.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ func (f *defaultFormats) Add(name string, strfmt Format, validator Validator) bo
nme := f.normalizeName(name)

tpe := reflect.TypeOf(strfmt)
if tpe.Kind() == reflect.Ptr {
if tpe.Kind() == reflect.Pointer {
tpe = tpe.Elem()
}

Expand Down Expand Up @@ -176,7 +176,7 @@ func (f *defaultFormats) DelByFormat(strfmt Format) bool {
defer f.Unlock()

tpe := reflect.TypeOf(strfmt)
if tpe.Kind() == reflect.Ptr {
if tpe.Kind() == reflect.Pointer {
tpe = tpe.Elem()
}

Expand Down Expand Up @@ -208,7 +208,7 @@ func (f *defaultFormats) ContainsFormat(strfmt Format) bool {
f.Lock()
defer f.Unlock()
tpe := reflect.TypeOf(strfmt)
if tpe.Kind() == reflect.Ptr {
if tpe.Kind() == reflect.Pointer {
tpe = tpe.Elem()
}

Expand Down
Loading