Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddTag ¶
AddTag searches for build tags in the Go source (src) and adds the provided tag (tag) if it doesn't already exist. The function looks for both `//go:build` (new format) and `// +build` (old format) and ensures that the new tag is added under the appropriate format. If neither build tag format exists, it adds a `//go:build` directive at the top of the file. If the tag already exists, the original source is returned.
The function doesn't attempt to rewrite the whole file but operates on the source text to add tags directly.
func HasBuildTag ¶
HasBuildTag checks if the src contains any of the provided build tags.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.