Created
February 29, 2024 03:48
-
-
Save tlindsay/0579cb631c459c561180605af966748d to your computer and use it in GitHub Desktop.
nilness with build-tags via golangci-lint
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
linters-settings: | |
govet: | |
disable-all: true | |
enable: | |
- nilness |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//go:build my_tag | |
package bar | |
import "os" | |
func DoTheThing() { | |
var foo []byte = nil | |
if foo != nil { | |
os.Exit(1) | |
} | |
os.Exit(0) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import "fmt" | |
func main() { | |
fmt.Println("yo") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment