Go build with multiple tags

As you can see here , go build accepts the "tags" flag, which will include files that are "tagged", i.e.

// +build foo

package main

....

will be excluded from

go build

but included in

go build -tags=foo

Is there a way to include multiple tags? I.e.

go build -tags=foo && bar
+4
source share
1 answer

Several labels can be included in the list, separated by spaces:

go build -tags="foo bar"
+3
source

Source: https://habr.com/ru/post/1656994/


All Articles