Skip to content
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

go/ast: remove MergePackageFiles for Go2 (it's not used, and buggy) #7124

Open
gopherbot opened this issue Jan 14, 2014 · 2 comments

Comments

@gopherbot
Copy link

commented Jan 14, 2014

by bgarcia@golang.org:

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() }
@griesemer

This comment has been minimized.

Copy link
Contributor

commented Feb 28, 2014

Comment 3:

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.

Status changed to Accepted.

@rsc rsc added this to the Unplanned milestone Apr 10, 2015

@rsc rsc removed release-none labels Apr 10, 2015

@bcmills

This comment has been minimized.

Copy link
Member

commented Sep 24, 2018

Should decide whether to delete or deprecate this function.

It's been 4½ years. We should make that decision, especially in light of Go 2. 🙂

@griesemer griesemer changed the title go/ast: MergePackageFiles is buggy go/ast: remove MergePackageFiles for Go2 (it's not used, and buggy) Sep 24, 2018

@griesemer griesemer modified the milestones: Unplanned, Proposal Sep 24, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.