Here I have the content to give the presentation about golangci-lint
To start the slides, inside the ./slides/ folder, run:
npm start
Example on how the AST looks like for a small .go file
cd astexample && make t
Exercise to implement uber style guideline Prefix Unerxported Globals with _.
Bad | Good |
---|---|
// foo.go
const (
defaultPort = 8080
defaultUser = "user"
)
// bar.go
func Bar() {
defaultPort := 9090
...
fmt.Println("Default port", defaultPort)
// We will not see a compile error if the first line of
// Bar() is deleted.
} |
// foo.go
const (
_defaultPort = 8080
_defaultUser = "user"
) |
To implement: analyzer.go
Small web app to run custom plugin linters.
- Improve slides