You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The parser.ParseComments option to parser.ParseFile
causes ast.MergePackageFiles to create a broken merge.
What steps will reproduce the problem?
This code reproduces the problem:
http://play.golang.org/p/63LsxcrpWi
You can also run godoc with --src option for a package with multiple source files, like strings.
What is the expected output?
// Package foo does bar and baz.
package foo
type string struct{}
// Foo is a structure.
type Foo struct{}
// String outputs Foo in a human-readable way.
func (f *Foo) String() string { return string{} }
// Error method for Foo.
func (f *Foo) Error() string { return f.String() }
What do you see instead?
package
// Foo is a structure.
foo
type string struct{}
type Foo struct{}
// String outputs Foo in a human-readable way.
// Package foo does bar and baz.
// Error method for Foo.
func (f *Foo) String() string { return string{} }
func (f *Foo) Error() string { return f.String() }
The text was updated successfully, but these errors were encountered:
ast.MergePackageFiles was implemented with it's former use in godoc in mind; at a time
when tools and the language were still somewhat in flux. godoc is not using
ast.MergePackageFiles anymore, so it's not a blocker for godoc.
Should decide whether to delete or deprecate this function.
ianlancetaylor
changed the title
go/ast: remove MergePackageFiles for Go2 (it's not used, and buggy)
go/ast/v2: remove MergePackageFiles for v2 (it's not used, and buggy)
Aug 23, 2023
ianlancetaylor
added
v2
A language change or incompatible library change
and removed
NeedsDecision
Feedback is required from experts, contributors, and/or the community before a change can be made.
v2
A language change or incompatible library change
labels
Aug 23, 2023
by bgarcia@golang.org:
The text was updated successfully, but these errors were encountered: