Skip to content

Commit

Permalink
feat: update golang to 1.22 (#305)
Browse files Browse the repository at this point in the history
  • Loading branch information
SevereCloud authored Jan 12, 2025
1 parent 5dabb67 commit b01a28d
Show file tree
Hide file tree
Showing 15 changed files with 30 additions and 133 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.go text eol=lf
2 changes: 1 addition & 1 deletion .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ jobs:
- name: golangci-lint
uses: golangci/golangci-lint-action@v4
with:
version: v1.56.2
version: v1.63.4
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ jobs:
test:
strategy:
matrix:
go-version: [1.21.x, 1.x]
go-version: [1.22.x, 1.x]
platform: [ubuntu-latest]
runs-on: ${{ matrix.platform }}
steps:
Expand Down
20 changes: 17 additions & 3 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ linters:
- asciicheck
- nolintlint
- gofumpt
- goerr113
- err113
- tparallel
- errorlint
- paralleltest
Expand Down Expand Up @@ -67,7 +67,7 @@ linters:
- gocheckcompilerdirectives
- asasalint

- musttag
# - musttag

- gosmopolitan
- mirror
Expand All @@ -81,6 +81,18 @@ linters:

- wrapcheck

- copyloopvar
- intrange

- fatcontext
- canonicalheader

- iface

- exptostd
- nilnesserr
- usetesting

# - testpackage # TODO: Fix testpackage
# - noctx # TODO: Fix noctx

Expand Down Expand Up @@ -122,6 +134,8 @@ linters:
# - protogetter
# - spancheck

# - recvcheck # false positive

# depricated
# - maligned
# - interfacer
Expand Down Expand Up @@ -159,4 +173,4 @@ linters-settings:
testifylint:
enable-all: true
disable:
- require-error # f func false positive
- require-error # f func false positive
3 changes: 2 additions & 1 deletion api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ func buildQuery(sliceParams ...Params) (context.Context, url.Values) {
case "access_token":
continue
case ":context":
//nolint:fatcontext
ctx = value.(context.Context)
default:
query.Set(key, FmtValue(value, 0))
Expand Down Expand Up @@ -396,7 +397,7 @@ func fmtReflectValue(value reflect.Value, depth int) string {
case reflect.Array, reflect.Slice:
s := ""

for i := 0; i < f.Len(); i++ {
for i := range f.Len() {
if i > 0 {
s += ","
}
Expand Down
2 changes: 1 addition & 1 deletion api/api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ func TestVK_RequestLimit(t *testing.T) {

var wg sync.WaitGroup

for i := 0; i < 20; i++ {
for range 20 {
wg.Add(1)

go func() {
Expand Down
4 changes: 2 additions & 2 deletions api/oauth/oauth.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ const (

// CheckScope ...
func CheckScope(scope int, permissions ...int) bool {
for i := 0; i < len(permissions); i++ {
if scope&permissions[i] != permissions[i] {
for _, value := range permissions {
if scope&value != value {
return false
}
}
Expand Down
1 change: 0 additions & 1 deletion callback/callback_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,6 @@ func TestCallback_HandleFunc(t *testing.T) {
}

for _, tt := range tests {
tt := tt
t.Run(tt.name, func(t *testing.T) {
t.Parallel()

Expand Down
Loading

0 comments on commit b01a28d

Please sign in to comment.