-
Notifications
You must be signed in to change notification settings - Fork 18.8k
Open
Description
Proposal Details
Background: This behavior is not helpful:
f := token.NewFileSet().AddFile("foo.go", -1, 0)
fmt.Println(f) // "&{foo.go 1 0 {{} {0 0}} [0] []}"Proposal: We propose to add this String method to token.File:
package token // "go/token"
// String returns a brief description of the file.
func (f *File) String() string {
return fmt.Sprintf("%s(%d-%d)", f.Name(), f.Base(), f.End())
}[Edited Nov 13 to return more than just the name.]
Reactions are currently unavailable
Metadata
Metadata
Assignees
Type
Projects
Status
Accepted