Skip to content

go/types: NewParam/NewField doc missing #22747

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
willfaught opened this issue Nov 15, 2017 · 3 comments
Closed

go/types: NewParam/NewField doc missing #22747

willfaught opened this issue Nov 15, 2017 · 3 comments
Labels
Documentation Issues describing a change to documentation. FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@willfaught
Copy link
Contributor

willfaught commented Nov 15, 2017

It's unclear what the package param is for, or if it's required (it seems it isn't, from my testing, if all you're doing is calling String() on the constructed types), or that the name must not be empty for anonymous fields.

It would be helpful to point out in the NewField doc that, for anonymous fields, you can get the name to use from the type argument, where that type is either a Named, Basic, or Pointer.


Consider this also a request to document all undocumented, exported declarations in go/types:

  • Universe
  • Unsafe
  • (...) String() string
  • (...) Underlying() Type
  • func (obj *Builtin) Exported() bool
  • func (obj *Builtin) Id() string
  • func (obj *Builtin) Name() string
  • func (obj *Builtin) Parent() *Scope
  • func (obj *Builtin) Pkg() *Package
  • func (obj *Builtin) Pos() token.Pos
  • func (obj *Builtin) Type() Type
  • func (obj *Const) Exported() bool
  • func (obj *Const) Id() string
  • func (obj *Const) Name() string
  • func (obj *Const) Parent() *Scope
  • func (obj *Const) Pkg() *Package
  • func (obj *Const) Pos() token.Pos
  • func (obj *Const) Type() Type
  • func (obj *Const) Val() constant.Value
  • func NewFunc(pos token.Pos, pkg *Package, name string, sig *Signature) *Func
  • func (obj *Func) Exported() bool
  • func (obj *Func) Id() string
  • func (obj *Func) Name() string
  • func (obj *Func) Parent() *Scope
  • func (obj *Func) Pkg() *Package
  • func (obj *Func) Pos() token.Pos
  • func (obj *Func) Scope() *Scope
  • func (obj *Func) Type() Type
  • func NewLabel(pos token.Pos, pkg *Package, name string) *Label
  • func (obj *Label) Exported() bool
  • func (obj *Label) Id() string
  • func (obj *Label) Name() string
  • func (obj *Label) Parent() *Scope
  • func (obj *Label) Pkg() *Package
  • func (obj *Label) Pos() token.Pos
  • func (obj *Label) Type() Type
  • func (obj *Nil) Exported() bool
  • func (obj *Nil) Id() string
  • func (obj *Nil) Name() string
  • func (obj *Nil) Parent() *Scope
  • func (obj *Nil) Pkg() *Package
  • func (obj *Nil) Pos() token.Pos
  • func (obj *PkgName) Exported() bool
  • func (obj *PkgName) Id() string
  • func (obj *PkgName) Parent() *Scope
  • func (obj *PkgName) Pkg() *Package
  • func (obj *PkgName) Pos() token.Pos
  • func (obj *PkgName) Type() Type
  • func (s *Scope) End() token.Pos
  • func (s *StdSizes) Alignof(T Type) int64
  • func (s *StdSizes) Offsetsof(fields []*Var) []int64
  • func (s *StdSizes) Sizeof(T Type) int64
  • func (obj *TypeName) Exported() bool
  • func (obj *TypeName) Id() string
  • func (obj *TypeName) Name() string
  • func (obj *TypeName) Parent() *Scope
  • func (obj *TypeName) Pkg() *Package
  • func (obj *TypeName) Pos() token.Pos
  • func (obj *TypeName) Type() Type
  • func NewField(pos token.Pos, pkg *Package, name string, typ Type, anonymous bool) *Var
  • func NewParam(pos token.Pos, pkg *Package, name string, typ Type) *Var
  • func NewVar(pos token.Pos, pkg *Package, name string, typ Type) *Var
  • func (obj *Var) Anonymous() bool
  • func (obj *Var) Exported() bool
  • func (obj *Var) Id() string
  • func (obj *Var) IsField() bool
  • func (obj *Var) Name() string
  • func (obj *Var) Parent() *Scope
  • func (obj *Var) Pkg() *Package
  • func (obj *Var) Pos() token.Pos
  • func (obj *Var) Type() Type
@mvdan
Copy link
Member

mvdan commented Nov 15, 2017

/cc @alandonovan @griesemer

@mvdan mvdan added the Documentation Issues describing a change to documentation. label Nov 15, 2017
@griesemer griesemer self-assigned this Dec 20, 2017
@ianlancetaylor ianlancetaylor added this to the Go1.11 milestone Mar 29, 2018
@ianlancetaylor ianlancetaylor added the NeedsFix The path to resolution is known, but the work has not been done. label Mar 29, 2018
@gopherbot
Copy link
Contributor

Change https://golang.org/cl/110975 mentions this issue: go/types: add doc strings to various undocumented exported objects

@willfaught
Copy link
Contributor Author

Thank you!

@golang golang locked and limited conversation to collaborators May 2, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Documentation Issues describing a change to documentation. FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

5 participants