Skip to content
This repository has been archived by the owner on Feb 22, 2023. It is now read-only.

Document requirement for IgnoreAllUnexported #3

Open
neild opened this issue Dec 14, 2021 · 0 comments
Open

Document requirement for IgnoreAllUnexported #3

neild opened this issue Dec 14, 2021 · 0 comments

Comments

@neild
Copy link
Contributor

neild commented Dec 14, 2021

cpy.New currently requires that the user pass cpy.IgnoreAllUnexported. Document this requirement, or change it.

We require that the user specify this option because it isn't clear what the correct default handling of unexported fields is. (See TODO in the code detailing various possibilities.) If we're confident that there is no natural default and the user will always be required to pick a behavior, perhaps we should promote this option to the function signature:

type Mode int

const (
  IgnoreAllUnexported Mode = iota
)

func New(mode Mode, opts ...Option) *Machine { ... }
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant