make+build: compile build tags into binary
This commit is contained in:
2 files changed
+25
-6
No files matched your search
@@ -20,6 +20,10 @@ var (
|
||||
// CommitHash stores the current commit hash of this build, this should
|
||||
// be set using the -ldflags during compilation.
|
||||
CommitHash string
|
||||
|
||||
// RawTags contains the raw set of build tags, separated by commas. This
|
||||
// should be set using -ldflags during compilation.
|
||||
RawTags string
|
||||
)
|
||||
|
||||
// semanticAlphabet is the set of characters that are permitted for use in an
|
||||
@@ -74,3 +78,12 @@ func Version() string {
|
||||
|
||||
return version
|
||||
}
|
||||
|
||||
// Tags returns the list of build tags that were compiled into the executable.
|
||||
func Tags() []string {
|
||||
if len(RawTags) == 0 {
|
||||
return nil
|
||||
}
|
||||
|
||||
return strings.Split(RawTags, ",")
|
||||
}
|
||||
Reference in new issue
Block a user