Browse Source

codecgen: add build tag to generated code that it is only supported in go 1.6+

Ugorji Nwoke 6 years ago
parent
commit
39e69f67bb
1 changed files with 1 additions and 1 deletions
  1. 1 1
      codec/gen.go

+ 1 - 1
codec/gen.go

@@ -277,9 +277,9 @@ func Gen(w io.Writer, buildTags, pkgName, uid string, noExtensions bool,
 		}
 		x.genRefPkgs(t)
 	}
+	x.line("// +build go1.6")
 	if buildTags != "" {
 		x.line("// +build " + buildTags)
-		x.line("")
 	}
 	x.line(`