Commit e18b2f3a authored by Tim Hockin's avatar Tim Hockin

Revert Clayton's #26179 so I can recreate it

His PR cam during the middle of this development cycle, and it was easier to burn it down and recreate it than try to patch it into an existing series and re-test every assumption. This behavior will be re-introduced in subsequent commits.
parent 3494f8e2
...@@ -105,7 +105,6 @@ func (g *GeneratorArgs) NewBuilder() (*parser.Builder, error) { ...@@ -105,7 +105,6 @@ func (g *GeneratorArgs) NewBuilder() (*parser.Builder, error) {
b.AddBuildTags(g.GeneratedBuildTag) b.AddBuildTags(g.GeneratedBuildTag)
for _, d := range g.InputDirs { for _, d := range g.InputDirs {
d = strings.TrimLeft(d, "+-*")
if g.Recursive { if g.Recursive {
if err := b.AddDirRecursive(d); err != nil { if err := b.AddDirRecursive(d); err != nil {
return nil, fmt.Errorf("unable to add directory %q: %v", d, err) return nil, fmt.Errorf("unable to add directory %q: %v", d, err)
......
...@@ -19,7 +19,6 @@ package generators ...@@ -19,7 +19,6 @@ package generators
import ( import (
"fmt" "fmt"
"io" "io"
"path"
"path/filepath" "path/filepath"
"strings" "strings"
...@@ -32,15 +31,6 @@ import ( ...@@ -32,15 +31,6 @@ import (
"github.com/golang/glog" "github.com/golang/glog"
) )
// Constraints is a set of optional limitations on what deep copy will generate.
type Constraints struct {
// PackageConstraints is an optional set of package prefixes that constrain which types
// will have inline deep copy methods generated for. Any type outside of these packages
// (if specified) will not have a function generated and will result in a call to the
// cloner.DeepCopy method.
PackageConstraints []string
}
// TODO: This is created only to reduce number of changes in a single PR. // TODO: This is created only to reduce number of changes in a single PR.
// Remove it and use PublicNamer instead. // Remove it and use PublicNamer instead.
func deepCopyNamer() *namer.NameStrategy { func deepCopyNamer() *namer.NameStrategy {
...@@ -72,32 +62,7 @@ func Packages(context *generator.Context, arguments *args.GeneratorArgs) generat ...@@ -72,32 +62,7 @@ func Packages(context *generator.Context, arguments *args.GeneratorArgs) generat
glog.Fatalf("Failed loading boilerplate: %v", err) glog.Fatalf("Failed loading boilerplate: %v", err)
} }
initInputs := sets.NewString() inputs := sets.NewString(arguments.InputDirs...)
explicitInputs := sets.NewString()
inputs := sets.NewString()
for _, s := range arguments.InputDirs {
switch {
case strings.HasPrefix(s, "+"):
// packages with '+' prefix get functions generated for everything except gencopy=false, but
// no init function
s = strings.TrimPrefix(s, "+")
inputs.Insert(s)
case strings.HasPrefix(s, "-"):
// packages with '-' prefix only get functions generated for those with gencopy=true
s = strings.TrimPrefix(s, "-")
inputs.Insert(s)
explicitInputs.Insert(s)
default:
inputs.Insert(s)
initInputs.Insert(s)
}
}
var restrictRange []string
if c, ok := arguments.CustomArgs.(Constraints); ok {
restrictRange = c.PackageConstraints
}
packages := generator.Packages{} packages := generator.Packages{}
header := append([]byte(fmt.Sprintf("// +build !%s\n\n", arguments.GeneratedBuildTag)), boilerplate...) header := append([]byte(fmt.Sprintf("// +build !%s\n\n", arguments.GeneratedBuildTag)), boilerplate...)
header = append(header, []byte( header = append(header, []byte(
...@@ -108,31 +73,11 @@ func Packages(context *generator.Context, arguments *args.GeneratorArgs) generat ...@@ -108,31 +73,11 @@ func Packages(context *generator.Context, arguments *args.GeneratorArgs) generat
for _, p := range context.Universe { for _, p := range context.Universe {
copyableType := false copyableType := false
for _, t := range p.Types { for _, t := range p.Types {
if copyableWithinPackage(t, explicitInputs.Has(t.Name.Package)) && inputs.Has(t.Name.Package) { if copyableWithinPackage(t) && inputs.Has(t.Name.Package) {
copyableType = true copyableType = true
} }
} }
if copyableType { if copyableType {
// TODO: replace this with a more sophisticated algorithm that generates private copy methods
// (like auto_DeepCopy_...) for any type that is outside of the PackageConstraints. That would
// avoid having to make a reflection call.
canInlineTypeFn := func(c *generator.Context, t *types.Type) bool {
// types must be public structs or have a custom DeepCopy_<method> already defined
if publicCopyFunctionDefined(c, t) {
return true
}
if !copyableWithinPackage(t, explicitInputs.Has(t.Name.Package)) {
return false
}
// only packages within the restricted range can be inlined
for _, s := range restrictRange {
if strings.HasPrefix(t.Name.Package, s) {
return true
}
}
return false
}
path := p.Path path := p.Path
packages = append(packages, packages = append(packages,
&generator.DefaultPackage{ &generator.DefaultPackage{
...@@ -142,7 +87,7 @@ func Packages(context *generator.Context, arguments *args.GeneratorArgs) generat ...@@ -142,7 +87,7 @@ func Packages(context *generator.Context, arguments *args.GeneratorArgs) generat
GeneratorFunc: func(c *generator.Context) (generators []generator.Generator) { GeneratorFunc: func(c *generator.Context) (generators []generator.Generator) {
generators = []generator.Generator{} generators = []generator.Generator{}
generators = append( generators = append(
generators, NewGenDeepCopy("deep_copy_generated", path, initInputs.Has(path), explicitInputs.Has(path), canInlineTypeFn)) generators, NewGenDeepCopy("deep_copy_generated", path, inputs.Has(path)))
return generators return generators
}, },
FilterFunc: func(c *generator.Context, t *types.Type) bool { FilterFunc: func(c *generator.Context, t *types.Type) bool {
...@@ -154,9 +99,6 @@ func Packages(context *generator.Context, arguments *args.GeneratorArgs) generat ...@@ -154,9 +99,6 @@ func Packages(context *generator.Context, arguments *args.GeneratorArgs) generat
return packages return packages
} }
// CanInlineTypeFunc should return true if the provided type can be converted to a function call
type CanInlineTypeFunc func(*generator.Context, *types.Type) bool
const ( const (
apiPackagePath = "k8s.io/kubernetes/pkg/api" apiPackagePath = "k8s.io/kubernetes/pkg/api"
conversionPackagePath = "k8s.io/kubernetes/pkg/conversion" conversionPackagePath = "k8s.io/kubernetes/pkg/conversion"
...@@ -165,30 +107,23 @@ const ( ...@@ -165,30 +107,23 @@ const (
// genDeepCopy produces a file with autogenerated deep-copy functions. // genDeepCopy produces a file with autogenerated deep-copy functions.
type genDeepCopy struct { type genDeepCopy struct {
generator.DefaultGen generator.DefaultGen
targetPackage string
targetPackage string imports namer.ImportTracker
imports namer.ImportTracker typesForInit []*types.Type
typesForInit []*types.Type generateInitFunc bool
generateInitFunc bool
requireExplicitTag bool
canInlineTypeFn CanInlineTypeFunc
context *generator.Context
globalVariables map[string]interface{} globalVariables map[string]interface{}
} }
func NewGenDeepCopy(sanitizedName, targetPackage string, generateInitFunc, requireExplicitTag bool, canInlineTypeFn CanInlineTypeFunc) generator.Generator { func NewGenDeepCopy(sanitizedName, targetPackage string, generateInitFunc bool) generator.Generator {
return &genDeepCopy{ return &genDeepCopy{
DefaultGen: generator.DefaultGen{ DefaultGen: generator.DefaultGen{
OptionalName: sanitizedName, OptionalName: sanitizedName,
}, },
targetPackage: targetPackage, targetPackage: targetPackage,
imports: generator.NewImportTracker(), imports: generator.NewImportTracker(),
typesForInit: make([]*types.Type, 0), typesForInit: make([]*types.Type, 0),
generateInitFunc: generateInitFunc, generateInitFunc: generateInitFunc,
requireExplicitTag: requireExplicitTag,
canInlineTypeFn: canInlineTypeFn,
} }
} }
...@@ -199,29 +134,15 @@ func (g *genDeepCopy) Namers(c *generator.Context) namer.NameSystems { ...@@ -199,29 +134,15 @@ func (g *genDeepCopy) Namers(c *generator.Context) namer.NameSystems {
func (g *genDeepCopy) Filter(c *generator.Context, t *types.Type) bool { func (g *genDeepCopy) Filter(c *generator.Context, t *types.Type) bool {
// Filter out all types not copyable within the package. // Filter out all types not copyable within the package.
copyable := copyableWithinPackage(t, g.requireExplicitTag) copyable := copyableWithinPackage(t)
if copyable { if copyable {
g.typesForInit = append(g.typesForInit, t) g.typesForInit = append(g.typesForInit, t)
} }
return copyable return copyable
} }
// publicCopyFunctionDefined returns true if a DeepCopy function has already been defined in a given func copyableWithinPackage(t *types.Type) bool {
// package, which allows more efficient deep copy implementations to be defined by the caller. if types.ExtractCommentTags("+", t.CommentLines)["gencopy"] == "false" {
func publicCopyFunctionDefined(c *generator.Context, t *types.Type) bool {
p, ok := c.Universe[t.Name.Package]
if !ok {
return false
}
return p.Functions["DeepCopy_"+path.Base(t.Name.Package)+"_"+t.Name.Name] != nil
}
func copyableWithinPackage(t *types.Type, explicitCopyRequired bool) bool {
tag := types.ExtractCommentTags("+", t.CommentLines)["gencopy"]
if tag == "false" {
return false
}
if explicitCopyRequired && tag != "true" {
return false return false
} }
// TODO: Consider generating functions for other kinds too. // TODO: Consider generating functions for other kinds too.
...@@ -280,7 +201,6 @@ func (g *genDeepCopy) funcNameTmpl(t *types.Type) string { ...@@ -280,7 +201,6 @@ func (g *genDeepCopy) funcNameTmpl(t *types.Type) string {
} }
func (g *genDeepCopy) Init(c *generator.Context, w io.Writer) error { func (g *genDeepCopy) Init(c *generator.Context, w io.Writer) error {
g.context = c
cloner := c.Universe.Type(types.Name{Package: conversionPackagePath, Name: "Cloner"}) cloner := c.Universe.Type(types.Name{Package: conversionPackagePath, Name: "Cloner"})
g.imports.AddType(cloner) g.imports.AddType(cloner)
g.globalVariables = map[string]interface{}{ g.globalVariables = map[string]interface{}{
...@@ -366,7 +286,7 @@ func (g *genDeepCopy) doMap(t *types.Type, sw *generator.SnippetWriter) { ...@@ -366,7 +286,7 @@ func (g *genDeepCopy) doMap(t *types.Type, sw *generator.SnippetWriter) {
sw.Do("}\n", nil) sw.Do("}\n", nil)
default: default:
sw.Do("for key, val := range in {\n", nil) sw.Do("for key, val := range in {\n", nil)
if g.canInlineTypeFn(g.context, t.Elem) { if copyableWithinPackage(t.Elem) {
sw.Do("newVal := new($.|raw$)\n", t.Elem) sw.Do("newVal := new($.|raw$)\n", t.Elem)
funcName := g.funcNameTmpl(t.Elem) funcName := g.funcNameTmpl(t.Elem)
sw.Do(fmt.Sprintf("if err := %s(val, newVal, c); err != nil {\n", funcName), argsFromType(t.Elem)) sw.Do(fmt.Sprintf("if err := %s(val, newVal, c); err != nil {\n", funcName), argsFromType(t.Elem))
...@@ -398,7 +318,7 @@ func (g *genDeepCopy) doSlice(t *types.Type, sw *generator.SnippetWriter) { ...@@ -398,7 +318,7 @@ func (g *genDeepCopy) doSlice(t *types.Type, sw *generator.SnippetWriter) {
sw.Do("for i := range in {\n", nil) sw.Do("for i := range in {\n", nil)
if t.Elem.IsAssignable() { if t.Elem.IsAssignable() {
sw.Do("(*out)[i] = in[i]\n", nil) sw.Do("(*out)[i] = in[i]\n", nil)
} else if g.canInlineTypeFn(g.context, t.Elem) { } else if copyableWithinPackage(t.Elem) {
funcName := g.funcNameTmpl(t.Elem) funcName := g.funcNameTmpl(t.Elem)
sw.Do(fmt.Sprintf("if err := %s(in[i], &(*out)[i], c); err != nil {\n", funcName), argsFromType(t.Elem)) sw.Do(fmt.Sprintf("if err := %s(in[i], &(*out)[i], c); err != nil {\n", funcName), argsFromType(t.Elem))
sw.Do("return err\n", nil) sw.Do("return err\n", nil)
...@@ -437,7 +357,7 @@ func (g *genDeepCopy) doStruct(t *types.Type, sw *generator.SnippetWriter) { ...@@ -437,7 +357,7 @@ func (g *genDeepCopy) doStruct(t *types.Type, sw *generator.SnippetWriter) {
sw.Do("out.$.name$ = nil\n", args) sw.Do("out.$.name$ = nil\n", args)
sw.Do("}\n", nil) sw.Do("}\n", nil)
case types.Struct: case types.Struct:
if g.canInlineTypeFn(g.context, t) { if copyableWithinPackage(t) {
funcName := g.funcNameTmpl(t) funcName := g.funcNameTmpl(t)
sw.Do(fmt.Sprintf("if err := %s(in.$.name$, &out.$.name$, c); err != nil {\n", funcName), args) sw.Do(fmt.Sprintf("if err := %s(in.$.name$, &out.$.name$, c); err != nil {\n", funcName), args)
sw.Do("return err\n", nil) sw.Do("return err\n", nil)
...@@ -468,9 +388,9 @@ func (g *genDeepCopy) doInterface(t *types.Type, sw *generator.SnippetWriter) { ...@@ -468,9 +388,9 @@ func (g *genDeepCopy) doInterface(t *types.Type, sw *generator.SnippetWriter) {
func (g *genDeepCopy) doPointer(t *types.Type, sw *generator.SnippetWriter) { func (g *genDeepCopy) doPointer(t *types.Type, sw *generator.SnippetWriter) {
sw.Do("*out = new($.Elem|raw$)\n", t) sw.Do("*out = new($.Elem|raw$)\n", t)
if t.Elem.IsAssignable() { if t.Elem.Kind == types.Builtin {
sw.Do("**out = *in", nil) sw.Do("**out = *in", nil)
} else if g.canInlineTypeFn(g.context, t.Elem) { } else if copyableWithinPackage(t.Elem) {
funcName := g.funcNameTmpl(t.Elem) funcName := g.funcNameTmpl(t.Elem)
sw.Do(fmt.Sprintf("if err := %s(*in, *out, c); err != nil {\n", funcName), argsFromType(t.Elem)) sw.Do(fmt.Sprintf("if err := %s(*in, *out, c); err != nil {\n", funcName), argsFromType(t.Elem))
sw.Do("return err\n", nil) sw.Do("return err\n", nil)
......
...@@ -31,26 +31,8 @@ import ( ...@@ -31,26 +31,8 @@ import (
func main() { func main() {
arguments := args.Default() arguments := args.Default()
arguments.CustomArgs = generators.Constraints{
// Types outside of this package will be inlined.
PackageConstraints: []string{"k8s.io/kubernetes/"},
}
// Override defaults. These are Kubernetes specific input locations. // Override defaults. These are Kubernetes specific input locations.
arguments.InputDirs = []string{ arguments.InputDirs = []string{
// generate all types, but do not register them
"+k8s.io/kubernetes/pkg/api/unversioned",
"-k8s.io/kubernetes/pkg/api/meta",
"-k8s.io/kubernetes/pkg/api/meta/metatypes",
"-k8s.io/kubernetes/pkg/api/resource",
"-k8s.io/kubernetes/pkg/conversion",
"-k8s.io/kubernetes/pkg/labels",
"-k8s.io/kubernetes/pkg/runtime",
"-k8s.io/kubernetes/pkg/runtime/serializer",
"-k8s.io/kubernetes/pkg/util/intstr",
"-k8s.io/kubernetes/pkg/util/sets",
"k8s.io/kubernetes/pkg/api", "k8s.io/kubernetes/pkg/api",
"k8s.io/kubernetes/pkg/api/v1", "k8s.io/kubernetes/pkg/api/v1",
"k8s.io/kubernetes/pkg/apis/authentication.k8s.io", "k8s.io/kubernetes/pkg/apis/authentication.k8s.io",
......
...@@ -2498,7 +2498,11 @@ func DeepCopy_api_Preconditions(in Preconditions, out *Preconditions, c *convers ...@@ -2498,7 +2498,11 @@ func DeepCopy_api_Preconditions(in Preconditions, out *Preconditions, c *convers
if in.UID != nil { if in.UID != nil {
in, out := in.UID, &out.UID in, out := in.UID, &out.UID
*out = new(types.UID) *out = new(types.UID)
**out = *in if newVal, err := c.DeepCopy(*in); err != nil {
return err
} else {
**out = newVal.(types.UID)
}
} else { } else {
out.UID = nil out.UID = nil
} }
......
...@@ -83,7 +83,6 @@ option go_package = "resource"; ...@@ -83,7 +83,6 @@ option go_package = "resource";
// writing some sort of special handling code in the hopes that that will // writing some sort of special handling code in the hopes that that will
// cause implementors to also use a fixed point implementation. // cause implementors to also use a fixed point implementation.
// //
// +gencopy=false
// +protobuf=true // +protobuf=true
// +protobuf.embed=string // +protobuf.embed=string
// +protobuf.options.marshal=false // +protobuf.options.marshal=false
......
...@@ -87,7 +87,6 @@ import ( ...@@ -87,7 +87,6 @@ import (
// writing some sort of special handling code in the hopes that that will // writing some sort of special handling code in the hopes that that will
// cause implementors to also use a fixed point implementation. // cause implementors to also use a fixed point implementation.
// //
// +gencopy=false
// +protobuf=true // +protobuf=true
// +protobuf.embed=string // +protobuf.embed=string
// +protobuf.options.marshal=false // +protobuf.options.marshal=false
......
...@@ -21,8 +21,9 @@ limitations under the License. ...@@ -21,8 +21,9 @@ limitations under the License.
package unversioned package unversioned
import ( import (
conversion "k8s.io/kubernetes/pkg/conversion"
time "time" time "time"
conversion "k8s.io/kubernetes/pkg/conversion"
) )
func DeepCopy_unversioned_APIGroup(in APIGroup, out *APIGroup, c *conversion.Cloner) error { func DeepCopy_unversioned_APIGroup(in APIGroup, out *APIGroup, c *conversion.Cloner) error {
......
...@@ -2446,7 +2446,11 @@ func DeepCopy_v1_Preconditions(in Preconditions, out *Preconditions, c *conversi ...@@ -2446,7 +2446,11 @@ func DeepCopy_v1_Preconditions(in Preconditions, out *Preconditions, c *conversi
if in.UID != nil { if in.UID != nil {
in, out := in.UID, &out.UID in, out := in.UID, &out.UID
*out = new(types.UID) *out = new(types.UID)
**out = *in if newVal, err := c.DeepCopy(*in); err != nil {
return err
} else {
**out = newVal.(types.UID)
}
} else { } else {
out.UID = nil out.UID = nil
} }
......
...@@ -576,7 +576,11 @@ func DeepCopy_extensions_NetworkPolicyPort(in NetworkPolicyPort, out *NetworkPol ...@@ -576,7 +576,11 @@ func DeepCopy_extensions_NetworkPolicyPort(in NetworkPolicyPort, out *NetworkPol
if in.Protocol != nil { if in.Protocol != nil {
in, out := in.Protocol, &out.Protocol in, out := in.Protocol, &out.Protocol
*out = new(api.Protocol) *out = new(api.Protocol)
**out = *in if newVal, err := c.DeepCopy(*in); err != nil {
return err
} else {
**out = newVal.(api.Protocol)
}
} else { } else {
out.Protocol = nil out.Protocol = nil
} }
......
...@@ -888,7 +888,11 @@ func DeepCopy_v1beta1_NetworkPolicyPort(in NetworkPolicyPort, out *NetworkPolicy ...@@ -888,7 +888,11 @@ func DeepCopy_v1beta1_NetworkPolicyPort(in NetworkPolicyPort, out *NetworkPolicy
if in.Protocol != nil { if in.Protocol != nil {
in, out := in.Protocol, &out.Protocol in, out := in.Protocol, &out.Protocol
*out = new(v1.Protocol) *out = new(v1.Protocol)
**out = *in if newVal, err := c.DeepCopy(*in); err != nil {
return err
} else {
**out = newVal.(v1.Protocol)
}
} else { } else {
out.Protocol = nil out.Protocol = nil
} }
......
...@@ -69,7 +69,6 @@ option go_package = "runtime"; ...@@ -69,7 +69,6 @@ option go_package = "runtime";
// in the Object. (TODO: In the case where the object is of an unknown type, a // in the Object. (TODO: In the case where the object is of an unknown type, a
// runtime.Unknown object will be created and stored.) // runtime.Unknown object will be created and stored.)
// //
// +gencopy=true
// +protobuf=true // +protobuf=true
message RawExtension { message RawExtension {
// Raw is the underlying serialization of this object. // Raw is the underlying serialization of this object.
...@@ -89,7 +88,6 @@ message RawExtension { ...@@ -89,7 +88,6 @@ message RawExtension {
// TypeMeta is provided here for convenience. You may use it directly from this package or define // TypeMeta is provided here for convenience. You may use it directly from this package or define
// your own with the same fields. // your own with the same fields.
// //
// +gencopy=true
// +protobuf=true // +protobuf=true
message TypeMeta { message TypeMeta {
optional string apiVersion = 1; optional string apiVersion = 1;
...@@ -103,7 +101,6 @@ message TypeMeta { ...@@ -103,7 +101,6 @@ message TypeMeta {
// TODO: Make this object have easy access to field based accessors and settors for // TODO: Make this object have easy access to field based accessors and settors for
// metadata and field mutatation. // metadata and field mutatation.
// //
// +gencopy=true
// +protobuf=true // +protobuf=true
message Unknown { message Unknown {
optional TypeMeta typeMeta = 1; optional TypeMeta typeMeta = 1;
......
...@@ -40,7 +40,6 @@ import ( ...@@ -40,7 +40,6 @@ import (
// TypeMeta is provided here for convenience. You may use it directly from this package or define // TypeMeta is provided here for convenience. You may use it directly from this package or define
// your own with the same fields. // your own with the same fields.
// //
// +gencopy=true
// +protobuf=true // +protobuf=true
type TypeMeta struct { type TypeMeta struct {
APIVersion string `json:"apiVersion,omitempty" yaml:"apiVersion,omitempty" protobuf:"bytes,1,opt,name=apiVersion"` APIVersion string `json:"apiVersion,omitempty" yaml:"apiVersion,omitempty" protobuf:"bytes,1,opt,name=apiVersion"`
...@@ -93,7 +92,6 @@ const ( ...@@ -93,7 +92,6 @@ const (
// in the Object. (TODO: In the case where the object is of an unknown type, a // in the Object. (TODO: In the case where the object is of an unknown type, a
// runtime.Unknown object will be created and stored.) // runtime.Unknown object will be created and stored.)
// //
// +gencopy=true
// +protobuf=true // +protobuf=true
type RawExtension struct { type RawExtension struct {
// Raw is the underlying serialization of this object. // Raw is the underlying serialization of this object.
...@@ -111,7 +109,6 @@ type RawExtension struct { ...@@ -111,7 +109,6 @@ type RawExtension struct {
// TODO: Make this object have easy access to field based accessors and settors for // TODO: Make this object have easy access to field based accessors and settors for
// metadata and field mutatation. // metadata and field mutatation.
// //
// +gencopy=true
// +protobuf=true // +protobuf=true
type Unknown struct { type Unknown struct {
TypeMeta `json:",inline" protobuf:"bytes,1,opt,name=typeMeta"` TypeMeta `json:",inline" protobuf:"bytes,1,opt,name=typeMeta"`
......
...@@ -30,7 +30,6 @@ option go_package = "intstr"; ...@@ -30,7 +30,6 @@ option go_package = "intstr";
// accept a name or number. // accept a name or number.
// TODO: Rename to Int32OrString // TODO: Rename to Int32OrString
// //
// +gencopy=true
// +protobuf=true // +protobuf=true
// +protobuf.options.(gogoproto.goproto_stringer)=false // +protobuf.options.(gogoproto.goproto_stringer)=false
message IntOrString { message IntOrString {
......
...@@ -32,7 +32,6 @@ import ( ...@@ -32,7 +32,6 @@ import (
// accept a name or number. // accept a name or number.
// TODO: Rename to Int32OrString // TODO: Rename to Int32OrString
// //
// +gencopy=true
// +protobuf=true // +protobuf=true
// +protobuf.options.(gogoproto.goproto_stringer)=false // +protobuf.options.(gogoproto.goproto_stringer)=false
type IntOrString struct { type IntOrString struct {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment