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/v2: remove MergePackageFiles for v2 (it's not used, and buggy) #7124

Open
gopherbot opened this issue Jan 14, 2014 · 2 comments
Open
Labels
Proposal v2 A language change or incompatible library change
Milestone

Comments

@gopherbot
Copy link

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
Copy link
Contributor

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.

@bcmills
Copy link
Contributor

bcmills 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. 🙂

@bcmills bcmills added the NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made. label Sep 24, 2018
@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 added Proposal v2 A language change or incompatible library change labels Sep 24, 2018
@griesemer griesemer modified the milestones: Unplanned, Proposal Sep 24, 2018
@ianlancetaylor 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 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Proposal v2 A language change or incompatible library change
Projects
None yet
Development

No branches or pull requests

5 participants