diff --git a/handler/handler.go b/handler/handler.go index 59ebb44..ac0051f 100644 --- a/handler/handler.go +++ b/handler/handler.go @@ -261,11 +261,6 @@ func (fi *FuncInfo) Wrap() Func { // Otherwise, if the field has a `json:"name"` tag and the name is not empty, // "name" is used. // -// Otherwise, if the field nas a `jrpc:"name"` tag, "name" is used. Note: This -// case is meant to support types with custom implementations of UnmarshalJSON. -// Assigning a name that does not match the field name can cause json.Unmarshal -// to report an error. -// // Otherwise, if the field is anonymous (embedded) it is skipped. To include an // anonymous field, ensure it is tagged for one of the previous rules. // diff --git a/handler/handler_test.go b/handler/handler_test.go index 2caed4b..3b37de1 100644 --- a/handler/handler_test.go +++ b/handler/handler_test.go @@ -167,11 +167,11 @@ func TestCheck_structArg(t *testing.T) { B int `json:"-"` C bool `json:",omitempty"` D byte // unspecified, use default name - Evil int `jrpc:"evil"` + Evil int `json:"eee"` } const base = `{"jsonrpc":"2.0","id":1,"method":"M","params":%s}` - const inputObj = `{"apple":"1","c":true,"d":25,"evil":666}` + const inputObj = `{"apple":"1","c":true,"d":25,"eee":666}` const inputArray = `["1", true, 25, 666]` fail := errors.New("fail") diff --git a/handler/positional.go b/handler/positional.go index 8684bba..539fb79 100644 --- a/handler/positional.go +++ b/handler/positional.go @@ -56,10 +56,6 @@ func structFieldNames(atype reflect.Type) (bool, []string) { } // fall through to other cases } - if tag, ok := fi.Tag.Lookup("jrpc"); ok { - names = append(names, tag) - continue - } if fi.Anonymous { // This is an untagged anonymous field. Tagged anonymous fields are // handled by the cases above.