diff --git a/bootstrap/bootstrap.go b/bootstrap/bootstrap.go index 5755bee..aff4fb4 100644 --- a/bootstrap/bootstrap.go +++ b/bootstrap/bootstrap.go @@ -187,7 +187,10 @@ func (g *Generator) Run() error { buildFlags := buildFlagsRegexp.FindAllString(g.GenBuildFlags, -1) execArgs = append(execArgs, buildFlags...) } - execArgs = append(execArgs, "-tags", g.BuildTags, filepath.Base(path)) + if len(g.BuildTags) > 0 { + execArgs = append(execArgs, "-tags", g.BuildTags) + } + execArgs = append(execArgs, filepath.Base(path)) cmd := exec.Command("go", execArgs...) cmd.Stdout = f diff --git a/raw.go b/raw.go index 81bd002..ee7367a 100644 --- a/raw.go +++ b/raw.go @@ -25,7 +25,8 @@ func (v *RawMessage) UnmarshalEasyJSON(l *jlexer.Lexer) { // UnmarshalJSON implements encoding/json.Unmarshaler interface. func (v *RawMessage) UnmarshalJSON(data []byte) error { - *v = data + *v = make([]byte, len(data)) + copy(*v, data) return nil }