Skip to content

Commit 08781ba

Browse files
committed
update to go1.22
1 parent dafe6c2 commit 08781ba

File tree

15 files changed

+66
-54
lines changed

15 files changed

+66
-54
lines changed

.github/workflows/build.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@ jobs:
44
build:
55
strategy:
66
matrix:
7-
go-version: [1.19.x]
7+
go-version: [1.22.x]
88
platform: [ubuntu-latest, macos-latest, windows-latest]
99
runs-on: ${{ matrix.platform }}
1010
steps:
1111
- name: setup
12-
uses: actions/setup-go@v2
12+
uses: actions/setup-go@v5
1313
with:
1414
go-version: ${{ matrix.go-version }}
1515
- name: checkout
16-
uses: actions/checkout@v2
16+
uses: actions/checkout@v4
1717
- name: build
1818
run: go build ./...

.github/workflows/lint.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,17 @@ jobs:
44
lint:
55
strategy:
66
matrix:
7-
go-version: [1.19.x]
7+
go-version: [1.22.x]
88
platform: [ubuntu-latest]
99
runs-on: ${{ matrix.platform }}
1010
steps:
1111
- name: setup
12-
uses: actions/setup-go@v2
12+
uses: actions/setup-go@v5
1313
with:
1414
go-version: ${{ matrix.go-version }}
15-
- uses: actions/checkout@v2
15+
- uses: actions/checkout@v4
1616
- name: golangci-lint
17-
uses: golangci/golangci-lint-action@v2
17+
uses: golangci/golangci-lint-action@v4
1818
with:
19-
version: v1.50
19+
version: v1.57
2020
args: -E misspell

.github/workflows/test.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,18 @@ jobs:
44
test:
55
strategy:
66
matrix:
7-
go-version: [1.19.x]
7+
go-version: [1.22.x]
88
platform: [ubuntu-latest, macos-latest, windows-latest]
99
runs-on: ${{ matrix.platform }}
1010
steps:
1111
- name: setup
12-
uses: actions/setup-go@v2
12+
uses: actions/setup-go@v5
1313
with:
1414
go-version: ${{ matrix.go-version }}
1515
- name: checkout
16-
uses: actions/checkout@v2
16+
uses: actions/checkout@v4
1717
- name: test
18-
uses: nick-invision/retry@v1
18+
uses: nick-invision/retry@v3
1919
with:
2020
max_attempts: 3
2121
timeout_minutes: 10

README.MD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ gopium walker package strategy_1 strategy_2 strategy_3 ...
3232

3333
## Requirements Installation and Usage
3434

35-
Gopium uses go1.19, but it's most likely gonna work with other versions too.
35+
Gopium uses go1.22, but it's most likely gonna work with other versions too.
3636
Note that Gopium is heavily relying on [types](https://golang.org/pkg/go/types/) and [ast](https://golang.org/pkg/go/ast/) packages, and these packages might be slightly different among major go releases.
3737

3838
To install Gopium VSCode Extension use [vscode marketplace](https://marketplace.visualstudio.com/items?itemName=1pkg.gopium).

fmtio/astutil/apply.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,10 @@ func combine(funcs ...gopium.Apply) gopium.Apply {
7373
// cat helps to filter only ast files
7474
// that exist inside hierarchic collection
7575
func cat(
76-
ctx context.Context,
76+
_ context.Context,
77+
//nolint
7778
pkg *ast.Package,
78-
loc gopium.Locator,
79+
_ gopium.Locator,
7980
c gopium.Categorized,
8081
) (*ast.Package, error) {
8182
files := make(map[string]*ast.File, len(pkg.Files))
@@ -93,6 +94,7 @@ func cat(
9394
// accordingly to gopium struct result
9495
// using custom fmtio ast formatter
9596
func ufmt(w gopium.Walk, fmt gopium.Ast) gopium.Apply {
97+
//nolint
9698
return func(
9799
ctx context.Context,
98100
pkg *ast.Package,
@@ -122,6 +124,7 @@ func ufmt(w gopium.Walk, fmt gopium.Ast) gopium.Apply {
122124
// it filters only comments inside
123125
// result structs and autogenerated comments
124126
func filter(w gopium.Walk) gopium.Apply {
127+
//nolint
125128
return func(
126129
ctx context.Context,
127130
pkg *ast.Package,
@@ -200,6 +203,7 @@ func filter(w gopium.Walk) gopium.Apply {
200203
// and ingest docs and comments directly
201204
// to file with correct calculated positions
202205
func note(w gopium.Walk, xp gopium.AstParser, p gopium.Printer) gopium.Apply {
206+
//nolint
203207
return func(
204208
ctx context.Context,
205209
pkg *ast.Package,

go.mod

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
module github.com/1pkg/gopium
22

3-
go 1.19
3+
go 1.22
44

55
require (
66
github.com/spf13/cobra v1.1.1
7-
golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a
8-
golang.org/x/tools v0.0.0-20200606014950-c42cb6316fb6
7+
golang.org/x/sync v0.7.0
8+
golang.org/x/tools v0.20.0
99
)
1010

1111
require (
1212
github.com/inconshreveable/mousetrap v1.0.0 // indirect
1313
github.com/spf13/pflag v1.0.5 // indirect
14-
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 // indirect
14+
golang.org/x/mod v0.17.0 // indirect
1515
)

go.sum

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,6 @@ github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UV
161161
github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw=
162162
github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U=
163163
github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU=
164-
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
165164
go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU=
166165
go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU=
167166
go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8=
@@ -173,7 +172,6 @@ golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnf
173172
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
174173
golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
175174
golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
176-
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
177175
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
178176
golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
179177
golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8=
@@ -192,8 +190,8 @@ golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU
192190
golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o=
193191
golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc=
194192
golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY=
195-
golang.org/x/mod v0.2.0 h1:KU7oHjnv3XNWfa5COkzUifxZmxp1TyI7ImMXqFxLwvQ=
196-
golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
193+
golang.org/x/mod v0.17.0 h1:zY54UmvipHiNd+pm+m0x9KhZ9hl1/7QNMyxXbc6ICqA=
194+
golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
197195
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
198196
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
199197
golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
@@ -208,7 +206,6 @@ golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn
208206
golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
209207
golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks=
210208
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
211-
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
212209
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
213210
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
214211
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
@@ -217,9 +214,8 @@ golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJ
217214
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
218215
golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
219216
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
220-
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
221-
golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a h1:WXEvlFVvvGxCJLG6REjsT03iWnKLEWinaScsxF2Vm2o=
222-
golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
217+
golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M=
218+
golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
223219
golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
224220
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
225221
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
@@ -255,13 +251,9 @@ golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtn
255251
golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
256252
golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
257253
golang.org/x/tools v0.0.0-20191112195655-aa38f8e97acc/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
258-
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
259-
golang.org/x/tools v0.0.0-20200606014950-c42cb6316fb6 h1:5Y8c5HBW6hBYnGEE3AbJPV0R8RsQmg1/eaJrpvasns0=
260-
golang.org/x/tools v0.0.0-20200606014950-c42cb6316fb6/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
254+
golang.org/x/tools v0.20.0 h1:hz/CVckiOxybQvFw6h7b/q80NTr9IUQb4s1IIzW7KNY=
255+
golang.org/x/tools v0.20.0/go.mod h1:WvitBU7JJf6A4jOdg4S1tviW9bhUxkgeCui/0JHctQg=
261256
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
262-
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
263-
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4=
264-
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
265257
google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE=
266258
google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M=
267259
google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg=

typepkg/maven.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88
// MavenGoTypes defines maven default "go/types" implementation
99
// that uses types.Sizes Sizeof in order to get type info
1010
type MavenGoTypes struct {
11-
sizes sizes `gopium:"filter_pads,memory_pack,cache_rounding_cpu_l1_discrete,struct_annotate_comment,add_tag_group_force"`
11+
sizes stdsizes `gopium:"filter_pads,memory_pack,cache_rounding_cpu_l1_discrete,struct_annotate_comment,add_tag_group_force"`
1212
caches map[uint]int64 `gopium:"filter_pads,memory_pack,cache_rounding_cpu_l1_discrete,struct_annotate_comment,add_tag_group_force"`
1313
_ [8]byte `gopium:"filter_pads,memory_pack,cache_rounding_cpu_l1_discrete,struct_annotate_comment,add_tag_group_force"`
1414
} // struct size: 32 bytes; struct align: 8 bytes; struct aligned size: 32 bytes; struct ptr scan size: 24 bytes; - 🌺 gopium @1pkg
@@ -25,7 +25,7 @@ func NewMavenGoTypes(compiler, arch string, caches ...int64) (MavenGoTypes, erro
2525
// try to get size for compiler and arch
2626
if sizes := types.SizesFor(compiler, arch); sizes != nil {
2727
return MavenGoTypes{
28-
sizes: stdsizes{sizes.(*types.StdSizes)},
28+
sizes: stdsizes{sizes},
2929
caches: cm,
3030
}, nil
3131
}
@@ -34,12 +34,12 @@ func NewMavenGoTypes(compiler, arch string, caches ...int64) (MavenGoTypes, erro
3434

3535
// SysWord MavenGoTypes implementation
3636
func (m MavenGoTypes) SysWord() int64 {
37-
return m.sizes.(stdsizes).WordSize
37+
return m.sizes.WordSize()
3838
}
3939

4040
// SysAlign MavenGoTypes implementation
4141
func (m MavenGoTypes) SysAlign() int64 {
42-
return m.sizes.(stdsizes).MaxAlign
42+
return m.sizes.MaxAlign()
4343
}
4444

4545
// SysCache MavenGoTypes implementation

typepkg/maven_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ func TestNewMavenGoTypes(t *testing.T) {
3737
arch: "amd64",
3838
caches: []int64{2, 4, 8, 16, 32},
3939
maven: MavenGoTypes{
40-
sizes: stdsizes{types.SizesFor("gc", "amd64").(*types.StdSizes)},
40+
sizes: stdsizes{types.SizesFor("gc", "amd64")},
4141
caches: map[uint]int64{
4242
1: 2,
4343
2: 4,

typepkg/parser_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,10 @@ func TestParserXToolPackagesAstTypes(t *testing.T) {
5353
err: tests.OnOS(
5454
"windows",
5555
fmt.Errorf("%s", "couldn't run 'go': chdir test: The system cannot find the file specified."),
56-
fmt.Errorf("%s", "couldn't run 'go': chdir test: no such file or directory"),
56+
fmt.Errorf("%s", "err: chdir test: no such file or directory: stderr: "),
5757
).(error),
5858
},
59-
"invalid pattern with abs path should return expected parser package": {
59+
"invalid pattern with abs path should return parser error": {
6060
p: ParserXToolPackagesAst{
6161
Pattern: "github.com/1pkg/gopium/gopium",
6262
Path: pdir,

0 commit comments

Comments
 (0)