Command gencodec generates marshaling methods for Go struct types.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gencodec/internal/tests/nameclash/input.go

34 lines
846 B

// Copyright 2017 Felix Lange <fjl@twurst.com>.
// Use of this source code is governed by the MIT license,
// which can be found in the LICENSE file.
//go:generate gencodec -type Y -field-override Yo -out output.go
package nameclash
import (
errors "github.com/fjl/gencodec/internal/clasherrors"
json "github.com/fjl/gencodec/internal/clashjson"
)
// This one clashes with the generated intermediate type name.
type YJSON struct{}
// This type clashes with a name in the override struct.
type enc int
// These types clash with variables, but are ignored because they're
// not referenced by the struct.
type input struct{}
type dec struct{}
type Y struct {
Foo json.Foo `optional:"true"`
Bar errors.Foo `optional:"true"`
Gazonk YJSON `optional:"true"`
Over int `optional:"true"`
}
type Yo struct {
Over enc
}