From 08781ba39e5e1b5ab3ee2e1225cb179f1e7d0863 Mon Sep 17 00:00:00 2001 From: Kostiantyn Masliuk <1pkg@protonmail.com> Date: Sun, 21 Apr 2024 17:21:01 -0700 Subject: [PATCH] update to go1.22 --- .github/workflows/build.yml | 6 +++--- .github/workflows/lint.yml | 10 +++++----- .github/workflows/test.yml | 8 ++++---- README.MD | 2 +- fmtio/astutil/apply.go | 8 ++++++-- go.mod | 8 ++++---- go.sum | 20 ++++++-------------- typepkg/maven.go | 8 ++++---- typepkg/maven_test.go | 2 +- typepkg/parser_test.go | 4 ++-- typepkg/sizes.go | 34 +++++++++++++++++++++++++--------- walkers/wdiff.go | 2 +- walkers/wdiff_test.go | 4 ++-- walkers/wout.go | 2 +- walkers/wout_test.go | 2 +- 15 files changed, 66 insertions(+), 54 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 08e958b..6038479 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -4,15 +4,15 @@ jobs: build: strategy: matrix: - go-version: [1.19.x] + go-version: [1.22.x] platform: [ubuntu-latest, macos-latest, windows-latest] runs-on: ${{ matrix.platform }} steps: - name: setup - uses: actions/setup-go@v2 + uses: actions/setup-go@v5 with: go-version: ${{ matrix.go-version }} - name: checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: build run: go build ./... diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 48e9cc7..2f44903 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -4,17 +4,17 @@ jobs: lint: strategy: matrix: - go-version: [1.19.x] + go-version: [1.22.x] platform: [ubuntu-latest] runs-on: ${{ matrix.platform }} steps: - name: setup - uses: actions/setup-go@v2 + uses: actions/setup-go@v5 with: go-version: ${{ matrix.go-version }} - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: golangci-lint - uses: golangci/golangci-lint-action@v2 + uses: golangci/golangci-lint-action@v4 with: - version: v1.50 + version: v1.57 args: -E misspell diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ce067c3..b94cbbc 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -4,18 +4,18 @@ jobs: test: strategy: matrix: - go-version: [1.19.x] + go-version: [1.22.x] platform: [ubuntu-latest, macos-latest, windows-latest] runs-on: ${{ matrix.platform }} steps: - name: setup - uses: actions/setup-go@v2 + uses: actions/setup-go@v5 with: go-version: ${{ matrix.go-version }} - name: checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: test - uses: nick-invision/retry@v1 + uses: nick-invision/retry@v3 with: max_attempts: 3 timeout_minutes: 10 diff --git a/README.MD b/README.MD index b4716fe..9ff9eed 100644 --- a/README.MD +++ b/README.MD @@ -32,7 +32,7 @@ gopium walker package strategy_1 strategy_2 strategy_3 ... ## Requirements Installation and Usage -Gopium uses go1.19, but it's most likely gonna work with other versions too. +Gopium uses go1.22, but it's most likely gonna work with other versions too. 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. To install Gopium VSCode Extension use [vscode marketplace](https://marketplace.visualstudio.com/items?itemName=1pkg.gopium). diff --git a/fmtio/astutil/apply.go b/fmtio/astutil/apply.go index f38d443..e1cc0b1 100644 --- a/fmtio/astutil/apply.go +++ b/fmtio/astutil/apply.go @@ -73,9 +73,10 @@ func combine(funcs ...gopium.Apply) gopium.Apply { // cat helps to filter only ast files // that exist inside hierarchic collection func cat( - ctx context.Context, + _ context.Context, + //nolint pkg *ast.Package, - loc gopium.Locator, + _ gopium.Locator, c gopium.Categorized, ) (*ast.Package, error) { files := make(map[string]*ast.File, len(pkg.Files)) @@ -93,6 +94,7 @@ func cat( // accordingly to gopium struct result // using custom fmtio ast formatter func ufmt(w gopium.Walk, fmt gopium.Ast) gopium.Apply { + //nolint return func( ctx context.Context, pkg *ast.Package, @@ -122,6 +124,7 @@ func ufmt(w gopium.Walk, fmt gopium.Ast) gopium.Apply { // it filters only comments inside // result structs and autogenerated comments func filter(w gopium.Walk) gopium.Apply { + //nolint return func( ctx context.Context, pkg *ast.Package, @@ -200,6 +203,7 @@ func filter(w gopium.Walk) gopium.Apply { // and ingest docs and comments directly // to file with correct calculated positions func note(w gopium.Walk, xp gopium.AstParser, p gopium.Printer) gopium.Apply { + //nolint return func( ctx context.Context, pkg *ast.Package, diff --git a/go.mod b/go.mod index 4ae8287..d3a3d95 100644 --- a/go.mod +++ b/go.mod @@ -1,15 +1,15 @@ module github.com/1pkg/gopium -go 1.19 +go 1.22 require ( github.com/spf13/cobra v1.1.1 - golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a - golang.org/x/tools v0.0.0-20200606014950-c42cb6316fb6 + golang.org/x/sync v0.7.0 + golang.org/x/tools v0.20.0 ) require ( github.com/inconshreveable/mousetrap v1.0.0 // indirect github.com/spf13/pflag v1.0.5 // indirect - golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 // indirect + golang.org/x/mod v0.17.0 // indirect ) diff --git a/go.sum b/go.sum index 24a8569..88757ef 100644 --- a/go.sum +++ b/go.sum @@ -161,7 +161,6 @@ github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UV github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= -github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= 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 golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= 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 golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= -golang.org/x/mod v0.2.0 h1:KU7oHjnv3XNWfa5COkzUifxZmxp1TyI7ImMXqFxLwvQ= -golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.17.0 h1:zY54UmvipHiNd+pm+m0x9KhZ9hl1/7QNMyxXbc6ICqA= +golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= 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 golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= 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 golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a h1:WXEvlFVvvGxCJLG6REjsT03iWnKLEWinaScsxF2Vm2o= -golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= +golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 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 golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191112195655-aa38f8e97acc/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20200606014950-c42cb6316fb6 h1:5Y8c5HBW6hBYnGEE3AbJPV0R8RsQmg1/eaJrpvasns0= -golang.org/x/tools v0.0.0-20200606014950-c42cb6316fb6/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.20.0 h1:hz/CVckiOxybQvFw6h7b/q80NTr9IUQb4s1IIzW7KNY= +golang.org/x/tools v0.20.0/go.mod h1:WvitBU7JJf6A4jOdg4S1tviW9bhUxkgeCui/0JHctQg= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= -golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= diff --git a/typepkg/maven.go b/typepkg/maven.go index b8d5559..7113007 100644 --- a/typepkg/maven.go +++ b/typepkg/maven.go @@ -8,7 +8,7 @@ import ( // MavenGoTypes defines maven default "go/types" implementation // that uses types.Sizes Sizeof in order to get type info type MavenGoTypes struct { - sizes sizes `gopium:"filter_pads,memory_pack,cache_rounding_cpu_l1_discrete,struct_annotate_comment,add_tag_group_force"` + sizes stdsizes `gopium:"filter_pads,memory_pack,cache_rounding_cpu_l1_discrete,struct_annotate_comment,add_tag_group_force"` caches map[uint]int64 `gopium:"filter_pads,memory_pack,cache_rounding_cpu_l1_discrete,struct_annotate_comment,add_tag_group_force"` _ [8]byte `gopium:"filter_pads,memory_pack,cache_rounding_cpu_l1_discrete,struct_annotate_comment,add_tag_group_force"` } // 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 // try to get size for compiler and arch if sizes := types.SizesFor(compiler, arch); sizes != nil { return MavenGoTypes{ - sizes: stdsizes{sizes.(*types.StdSizes)}, + sizes: stdsizes{sizes}, caches: cm, }, nil } @@ -34,12 +34,12 @@ func NewMavenGoTypes(compiler, arch string, caches ...int64) (MavenGoTypes, erro // SysWord MavenGoTypes implementation func (m MavenGoTypes) SysWord() int64 { - return m.sizes.(stdsizes).WordSize + return m.sizes.WordSize() } // SysAlign MavenGoTypes implementation func (m MavenGoTypes) SysAlign() int64 { - return m.sizes.(stdsizes).MaxAlign + return m.sizes.MaxAlign() } // SysCache MavenGoTypes implementation diff --git a/typepkg/maven_test.go b/typepkg/maven_test.go index 99feae6..aa13a49 100644 --- a/typepkg/maven_test.go +++ b/typepkg/maven_test.go @@ -37,7 +37,7 @@ func TestNewMavenGoTypes(t *testing.T) { arch: "amd64", caches: []int64{2, 4, 8, 16, 32}, maven: MavenGoTypes{ - sizes: stdsizes{types.SizesFor("gc", "amd64").(*types.StdSizes)}, + sizes: stdsizes{types.SizesFor("gc", "amd64")}, caches: map[uint]int64{ 1: 2, 2: 4, diff --git a/typepkg/parser_test.go b/typepkg/parser_test.go index c6e0b67..5dfcb29 100644 --- a/typepkg/parser_test.go +++ b/typepkg/parser_test.go @@ -53,10 +53,10 @@ func TestParserXToolPackagesAstTypes(t *testing.T) { err: tests.OnOS( "windows", fmt.Errorf("%s", "couldn't run 'go': chdir test: The system cannot find the file specified."), - fmt.Errorf("%s", "couldn't run 'go': chdir test: no such file or directory"), + fmt.Errorf("%s", "err: chdir test: no such file or directory: stderr: "), ).(error), }, - "invalid pattern with abs path should return expected parser package": { + "invalid pattern with abs path should return parser error": { p: ParserXToolPackagesAst{ Pattern: "github.com/1pkg/gopium/gopium", Path: pdir, diff --git a/typepkg/sizes.go b/typepkg/sizes.go index fcb7497..7b1d402 100644 --- a/typepkg/sizes.go +++ b/typepkg/sizes.go @@ -6,31 +6,46 @@ import ( "github.com/1pkg/gopium/collections" ) -// sizes is types sizes plus ptr data size interface -type sizes interface { - types.Sizes - Ptr(t types.Type) int64 +// ftype is a stub to extract WordSize and MaxAlign out of types.Sizes interface across gc and gccgo compilers. +type stubtype struct{} + +func (t stubtype) Underlying() types.Type { + return stubtype{} +} + +func (t stubtype) String() string { + return "" } // stdsizes implements sizes interface using types std sizes type stdsizes struct { - *types.StdSizes `gopium:"filter_pads,memory_pack,cache_rounding_cpu_l1_discrete,struct_annotate_comment,add_tag_group_force"` + types.Sizes `gopium:"filter_pads,memory_pack,cache_rounding_cpu_l1_discrete,struct_annotate_comment,add_tag_group_force"` } // struct size: 8 bytes; struct align: 8 bytes; struct aligned size: 8 bytes; struct ptr scan size: 8 bytes; - 🌺 gopium @1pkg +func (s stdsizes) WordSize() int64 { + // This should work for both gc and gccgo types as default case returning proper WordSize. + return s.Sizeof(stubtype{}) +} + +func (s stdsizes) MaxAlign() int64 { + // This should work for both gc and gccgo types as default case returning proper MaxAlign. + return s.Alignof(types.Typ[types.Complex128]) +} + // Ptr implementation is vendored from -// https://cs.opensource.google/go/x/tools/+/refs/tags/v0.1.7:go/analysis/passes/fieldalignment/fieldalignment.go;l=324 +// https://cs.opensource.google/go/x/tools/+/refs/tags/v0.9.3:go/analysis/passes/fieldalignment/fieldalignment.go;l=330 func (s stdsizes) Ptr(t types.Type) int64 { switch t := t.Underlying().(type) { case *types.Basic: switch t.Kind() { case types.String, types.UnsafePointer: - return s.WordSize + return s.WordSize() } return 0 case *types.Chan, *types.Map, *types.Pointer, *types.Signature, *types.Slice: - return s.WordSize + return s.WordSize() case *types.Interface: - return 2 * s.WordSize + return 2 * s.WordSize() case *types.Array: n := t.Len() if n == 0 { @@ -61,5 +76,6 @@ func (s stdsizes) Ptr(t types.Type) int64 { } return p } + return 0 } diff --git a/walkers/wdiff.go b/walkers/wdiff.go index ca0d817..31eeedb 100644 --- a/walkers/wdiff.go +++ b/walkers/wdiff.go @@ -88,7 +88,7 @@ func (w wdiff) Visit(ctx context.Context, regex *regexp.Regexp, stg gopium.Strat // write wast helps to apply formatter // to format strategies results and writer // to write result to output -func (w wdiff) write(ctx context.Context, ho collections.Hierarchic, hr collections.Hierarchic) error { +func (w wdiff) write(_ context.Context, ho collections.Hierarchic, hr collections.Hierarchic) error { // skip empty writes if ho.Len() == 0 || hr.Len() == 0 { return nil diff --git a/walkers/wdiff_test.go b/walkers/wdiff_test.go index 5c30fdd..11b9df3 100644 --- a/walkers/wdiff_test.go +++ b/walkers/wdiff_test.go @@ -339,7 +339,7 @@ func TestWdiff(t *testing.T) { { "Name": "AZ", "Type": "github.com/1pkg/gopium/tests/data/multi.AZ", - "Size": 33, + "Size": 40, "Align": 8, "Ptr": 0, "Tag": "", @@ -489,7 +489,7 @@ func TestWdiff(t *testing.T) { { "Name": "AZ", "Type": "github.com/1pkg/gopium/tests/data/multi.AZ", - "Size": 33, + "Size": 40, "Align": 8, "Ptr": 0, "Tag": "", diff --git a/walkers/wout.go b/walkers/wout.go index 5e3a028..810b224 100644 --- a/walkers/wout.go +++ b/walkers/wout.go @@ -95,7 +95,7 @@ func (w wout) Visit(ctx context.Context, regex *regexp.Regexp, stg gopium.Strate // write wout helps to apply formatter // to format strategies result and writer // to write result to output -func (w wout) write(ctx context.Context, h collections.Hierarchic) error { +func (w wout) write(_ context.Context, h collections.Hierarchic) error { // skip empty writes f := h.Flat() if len(f) == 0 { diff --git a/walkers/wout_test.go b/walkers/wout_test.go index 5581c6f..5dcbdb5 100644 --- a/walkers/wout_test.go +++ b/walkers/wout_test.go @@ -279,7 +279,7 @@ func TestWout(t *testing.T) { { "Name": "AZ", "Type": "github.com/1pkg/gopium/tests/data/multi.AZ", - "Size": 33, + "Size": 40, "Align": 8, "Ptr": 0, "Tag": "",