diff --git a/gen/decoder.go b/gen/decoder.go index 4fddbff..aaee03f 100644 --- a/gen/decoder.go +++ b/gen/decoder.go @@ -3,6 +3,7 @@ package gen import ( "encoding" "encoding/json" + "errors" "fmt" "reflect" "strings" @@ -338,6 +339,9 @@ func (g *Generator) genStructFieldDecoder(t reflect.Type, f reflect.StructField) if tags.omit { return nil } + if tags.intern && tags.noCopy { + return errors.New("Mutually exclusive tags are specified: 'intern' and 'nocopy'") + } fmt.Fprintf(g.out, " case %q:\n", jsonName) if err := g.genTypeDecoder(f.Type, "out."+f.Name, tags, 3); err != nil {