Skip to content

Conversation

@RyabovNick
Copy link

Fixed a bug where the linter failed to detect append issues when using slice type aliases imported from other packages (e.g., make(typespkg.S, 10) where type S []string is defined in a different package).

Added handling for *ast.SelectorExpr in isSlice() and use Underlying() to properly identify slice types from named type aliases.

Move the always and append folders under src for consistency with typespkg. Per the https://pkg.go.dev/golang.org/x/tools/go/analysis/analysistest

If the directory contains a go.mod file, Run treats it as the root of the Go module in which to work. Otherwise, Run treats it as the root of a GOPATH-style tree, with package contained in the src subdirectory.

The linter was not detecting append issues when the slice type was
imported from another package (e.g., `make(typespkg.S, 10)` where
`type S []string` is defined in a different package).

Added handling for *ast.SelectorExpr in isSlice() and use Underlying()
to properly identify slice types from named type aliases.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant