Source File
method.go
Belonging Package
github.com/goccy/go-json/internal/runtime
package runtimeimport// MethodLookup looks the method of one name up in a type, by reflect.Type.MethodByName with the name as a constant.//// The compiler tells the linker which names the calls of Method and MethodByName of reflect look up when it sees// them as constants, and the linker keeps the methods of those names only. A call with any other argument makes// the linker keep every exported method of every type of the program ( cmd/compile/internal/walk.usemethod ), so// the methods are looked up by these functions, each with its name in its code, and never by a name in a// variable.type MethodLookup func(reflect.Type) (reflect.Method, bool)// MarshalJSONMethod looks MarshalJSON up.func ( reflect.Type) (reflect.Method, bool) {return .MethodByName("MarshalJSON")}// MarshalTextMethod looks MarshalText up.func ( reflect.Type) (reflect.Method, bool) {return .MethodByName("MarshalText")}// AppendTextMethod looks AppendText up.func ( reflect.Type) (reflect.Method, bool) {return .MethodByName("AppendText")}// UnmarshalJSONMethod looks UnmarshalJSON up.func ( reflect.Type) (reflect.Method, bool) {return .MethodByName("UnmarshalJSON")}
![]() |
The pages are generated with Golds v0.8.7. (GOOS=linux GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds. |