Files
genqlient/graphql/util.go
T
Ben Kraft f600b6e5d3 Bump golangci-lint and (max) Go versions (#219)
Lint is failing with some inscrutable panic (on a commit with no code
changes). Let's try bumping the version in case they fixed it.

Additionally, the new version's github action uses Go 1.19, which means
it pulls in gofmt updates to match the new [doc-comment formatting rules][1].
So I added Go 1.19 to our list of versions to test (fixes #216)
and updated some of our doc-comments to format better in the
new world (mostly using the new link syntax).

[1]: https://go.dev/doc/comment

Test plan: make lint
2022-08-15 15:05:36 -07:00

43 lines
1.4 KiB
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].
//
// [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!")
}
// NoMarshalJSON is intended for the use of genqlient's generated code only.
//
// It is used to prevent a struct type from inheriting its embed's
// MarshalJSON method, so if we construct a type:
//
// type T struct { E; NoMarshalJSON }
//
// where E has an MarshalJSON method, T will not inherit it, per the
// [Go selector rules].
//
// [Go selector rules]: https://golang.org/ref/spec#Selectors.
type NoMarshalJSON struct{}
// MarshalJSON should never be called; it exists only to prevent a sibling
// MarshalJSON method from being promoted.
func (NoMarshalJSON) MarshalJSON() ([]byte, error) {
panic("NoUnmarshalJSON.MarshalJSON should never be called!")
}