Skip to content

Commit

Permalink
chore: bump golangci and go version
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelcaulley committed Dec 28, 2024
1 parent 159f393 commit 44c4de5
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 8 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,16 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: 1.22
go-version: 1.23
- name: Run linters
uses: golangci/golangci-lint-action@v3.7.0
uses: golangci/golangci-lint-action@v6.1.1
with:
version: v1.55.2
version: v1.62.2
test:
runs-on: ubuntu-latest
strategy:
matrix:
go: ['1.21', '1.22']
go: ['1.22', '1.23']
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
Expand All @@ -47,7 +47,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: '1.21'
go-version: '1.23'
- uses: actions/cache@v3
with:
path: ~/go/pkg/mod
Expand Down
2 changes: 1 addition & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
run:
go: '1.21'
go: '1.23'
timeout: 10m

linters-settings:
Expand Down
11 changes: 9 additions & 2 deletions entproto/adapter.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ package entproto
import (
"errors"
"fmt"
"math"
"path"
"path/filepath"
"strings"
Expand Down Expand Up @@ -387,7 +388,10 @@ func (a *Adapter) extractEdgeFieldDescriptor(source *gen.Type, e *gen.Edge) (*de
return nil, fmt.Errorf("entproto: edge %q has number 1 which is reserved for id", e.Name)
}

fieldNum := int32(edgeAnnotation.Number)
if num := int64(edgeAnnotation.Number); num > math.MaxInt32 || num < math.MinInt32 {
return nil, fmt.Errorf("value %v overflows int32", num)
}
fieldNum := int32(edgeAnnotation.Number) //nolint:gosec
fieldDesc := &descriptorpb.FieldDescriptorProto{
Number: &fieldNum,
Name: &e.Name,
Expand Down Expand Up @@ -461,7 +465,10 @@ func toProtoFieldDescriptor(f *gen.Field) (*descriptorpb.FieldDescriptorProto, e
if err != nil {
return nil, err
}
fieldNumber := int32(fann.Number)
if num := int64(fann.Number); num > math.MaxInt32 || num < math.MinInt32 {
return nil, fmt.Errorf("value %v overflows int32", num)
}
fieldNumber := int32(fann.Number) //nolint:gosec
if fieldNumber == 1 && strings.ToUpper(f.Name) != "ID" {
return nil, fmt.Errorf("entproto: field %q has number 1 which is reserved for id", f.Name)
}
Expand Down
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ require (
github.com/go-faster/jx v0.40.0 // indirect
github.com/go-faster/yamlx v0.4.1 // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/google/addlicense v1.1.1 // indirect
github.com/google/go-cmp v0.6.0 // indirect
github.com/gorilla/websocket v1.5.0 // indirect
github.com/hashicorp/errwrap v1.0.0 // indirect
Expand Down
4 changes: 4 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ github.com/arbovm/levenshtein v0.0.0-20160628152529-48b4e1c0c4d0 h1:jfIu9sQUG6Ig
github.com/arbovm/levenshtein v0.0.0-20160628152529-48b4e1c0c4d0/go.mod h1:t2tdKJDJF9BV14lnkjHmOQgcvEKgtqs5a1N3LNdJhGE=
github.com/benbjohnson/clock v1.3.0 h1:ip6w0uFQkncKQ979AypyG0ER7mqUSBdKLOgAle/AT8A=
github.com/benbjohnson/clock v1.3.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA=
github.com/bmatcuk/doublestar/v4 v4.0.2 h1:X0krlUVAVmtr2cRoTqR8aDMrDqnB36ht8wpWTiQ3jsA=
github.com/bmatcuk/doublestar/v4 v4.0.2/go.mod h1:xBQ8jztBU6kakFMg+8WGxn0c6z1fTSPVIjEY1Wr7jzc=
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
Expand Down Expand Up @@ -74,6 +76,8 @@ github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QD
github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek=
github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps=
github.com/google/addlicense v1.1.1 h1:jpVf9qPbU8rz5MxKo7d+RMcNHkqxi4YJi/laauX4aAE=
github.com/google/addlicense v1.1.1/go.mod h1:Sm/DHu7Jk+T5miFHHehdIjbi4M5+dJDRS3Cq0rncIxA=
github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
Expand Down

0 comments on commit 44c4de5

Please sign in to comment.