Skip to content

The model name file should use pointer receiver #637

Description

@tatsuhiro-t

Currently, the generated model name file contains value receiver:

func (in Foo) OpenFooName() string {
        return "com.example.Foo"
}

Meanwhile, deepcopy-gen generates pointer receiver functions like:

func (in *Foo) DeepCopyInto(out *Foo) {
        ...
}

Go spec allows mixing value and pointe receiver functions, but it might introduce subtle bugs.
recvcheck linter will flag them.

Could you please generate a model name file with pointer receiver?
If the backward compatibility is required, it would be nice to gate this feature behind the flag.

Thank you.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions