Skip to content

It seems like --build-tags might not be behaving as expected #2563

Closed Answered by ldez
zounm asked this question in Q&A
Discussion options

You must be logged in to vote

Hello,

debug.go and release.go don't have the same package (thing, codec) maybe it's just a mistake when you created the example.

If I fix the package problem, I can see your output:

$ golangci-lint run --build-tags=debug release.go debug.go
debug.go:8:6: `Assert` redeclared in this block (typecheck)
func Assert(cond bool, format string, args ...interface{}) {
     ^
release.go:6:6: other declaration of Assert (typecheck)
func Assert(cond bool, format string, args ...interface{}) {
     ^

But if I don't provide explicit files, the problem disappears:

$ golangci-lint run

So the behavior is expected because it's the same as Go.

files

release.go

//go:build !debug
// +build !debug

package m…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@zounm
Comment options

Answer selected by zounm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #2562 on February 13, 2022 08:23.