mirror of
https://github.com/netbirdio/easyjson.git
synced 2026-05-22 18:44:42 -07:00
don't allow intern/nocopy tags at the same time
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user