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
2 changes: 1 addition & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ linters:
- godox
- gosmopolitan
- inamedparam
- intrange # disabled while < go1.22
#- intrange # disabled while < go1.22
- ireturn
- lll
- musttag
Expand Down
2 changes: 1 addition & 1 deletion default.go
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ func isValidIPv4(parts []string) bool {
if len(digits) > 1 {
const maxUint8 = uint64(^uint8(0))

for i := 0; i < len(digits)-2; i++ {
for i := range len(digits) - 2 {
if digits[i] > maxUint8 {
return false
}
Expand Down
6 changes: 3 additions & 3 deletions default_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -928,7 +928,7 @@ func BenchmarkIsUUID(b *testing.B) {
uuid4s := make([]string, 0, sampleSize)
uuid5s := make([]string, 0, sampleSize)

for i := 0; i < sampleSize; i++ {
for range sampleSize {
seed := []byte(uuid.Must(uuid.NewRandom()).String())
uuids = append(uuids, uuid.Must(uuid.NewRandom()).String())
uuid3s = append(uuid3s, uuid.NewMD5(uuid.NameSpaceURL, seed).String())
Expand All @@ -954,8 +954,8 @@ func benchmarkIs(input []string, fn func(string) bool) func(*testing.B) {
var isTrue bool
b.ReportAllocs()
b.ResetTimer()
for i := 0; i < b.N; i++ {
isTrue = fn(input[i%len(input)])
for b.Loop() {
isTrue = fn(input[b.N%len(input)])
}
fmt.Fprintln(io.Discard, isTrue)
}
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module github.com/go-openapi/strfmt

require (
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2
github.com/go-openapi/errors v0.22.2
github.com/go-openapi/errors v0.22.3
github.com/go-viper/mapstructure/v2 v2.4.0
github.com/google/uuid v1.6.0
github.com/oklog/ulid v1.3.1
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 h1:DklsrG3d
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/go-openapi/errors v0.22.2 h1:rdxhzcBUazEcGccKqbY1Y7NS8FDcMyIRr0934jrYnZg=
github.com/go-openapi/errors v0.22.2/go.mod h1:+n/5UdIqdVnLIJ6Q9Se8HNGUXYaY6CN8ImWzfi/Gzp0=
github.com/go-openapi/errors v0.22.3 h1:k6Hxa5Jg1TUyZnOwV2Lh81j8ayNw5VVYLvKrp4zFKFs=
github.com/go-openapi/errors v0.22.3/go.mod h1:+WvbaBBULWCOna//9B9TbLNGSFOfF8lY9dw4hGiEiKQ=
github.com/go-viper/mapstructure/v2 v2.4.0 h1:EBsztssimR/CONLSZZ04E8qAkxNYq4Qp9LvH92wZUgs=
github.com/go-viper/mapstructure/v2 v2.4.0/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM=
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
Expand Down
4 changes: 2 additions & 2 deletions time.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ const (
ISO8601TimeWithReducedPrecisionLocaltime = "2006-01-02T15:04"
// ISO8601TimeUniversalSortableDateTimePattern represents a ISO8601 universal sortable date time pattern.
ISO8601TimeUniversalSortableDateTimePattern = "2006-01-02 15:04:05"
// short form of ISO8601TimeUniversalSortableDateTimePattern
// ISO8601TimeUniversalSortableDateTimePatternShortForm is the short form of ISO8601TimeUniversalSortableDateTimePattern
ISO8601TimeUniversalSortableDateTimePatternShortForm = "2006-01-02"
// DateTimePattern pattern to match for the date-time format from http://tools.ietf.org/html/rfc3339#section-5.6
DateTimePattern = `^([0-9]{2}):([0-9]{2}):([0-9]{2})(.[0-9]+)?(z|([+-][0-9]{2}:[0-9]{2}))$`
Expand Down Expand Up @@ -157,7 +157,7 @@ func (t DateTime) IsZero() bool {
return time.Time(t).IsZero()
}

// IsUnixZerom returns whether the date time is equivalent to time.Unix(0, 0).UTC().
// IsUnixZero returns whether the date time is equivalent to time.Unix(0, 0).UTC().
func (t DateTime) IsUnixZero() bool {
return time.Time(t).Equal(UnixZero)
}
Expand Down
Loading