Trim whitespace around build tags

This commit trims whitespace around the build tags specified on the
command line in order that invocations such as:

easyjson -build_tags linux

generate the correct "// +build linux" rather than adding additional
whitespace to give  "// +build  linux".
This commit is contained in:
James Nugent
2017-07-28 14:54:39 -05:00
parent 2f5df55504
commit 1a9a11a1d1
+6 -1
View File
@@ -54,8 +54,13 @@ func generate(fname string) (err error) {
outName = *specifiedName
}
var trimmedBuildTags string
if *buildTags != "" {
trimmedBuildTags = strings.TrimSpace(*buildTags)
}
g := bootstrap.Generator{
BuildTags: *buildTags,
BuildTags: trimmedBuildTags,
PkgPath: p.PkgPath,
PkgName: p.PkgName,
Types: p.StructNames,