Files
genqlient/graphql/util.go
T
Steve Coffman 673840e495 Picking some nits that my IDE complained about (#91)
* Picking some nits that my IDE complained about

Signed-off-by: Steve Coffman <steve@khanacademy.org>

* Update graphql/util.go

Co-authored-by: Ben Kraft <benkraft@khanacademy.org>

* revert to original for comment

Signed-off-by: Steve Coffman <steve@khanacademy.org>

Co-authored-by: Ben Kraft <benkraft@khanacademy.org>
2021-09-14 13:42:47 -04:00

20 lines
766 B
Go

package graphql
// Utility types used by the generated code. In general, these are *not*
// intended for end-users.
// NoUnmarshalJSON is intended for the use of genqlient's generated code only.
//
// It is used to prevent a struct type from inheriting its embed's
// UnmarshalJSON method, so if we construct a type:
// type T struct { E; NoUnmarshalJSON }
// where E has an UnmarshalJSON method, T will not inherit it, per the Go
// selector rules: https://golang.org/ref/spec#Selectors.
type NoUnmarshalJSON struct{}
// UnmarshalJSON should never be called; it exists only to prevent a sibling
// UnmarshalJSON method from being promoted.
func (NoUnmarshalJSON) UnmarshalJSON(b []byte) error {
panic("NoUnmarshalJSON.UnmarshalJSON should never be called!")
}