mirror of
https://github.com/golang/go
synced 2024-11-05 17:06:13 -07:00
5cb1c80a83
Document a risk of generating invalid code due to shadowing between identifiers in code files and the imported package names. This risk was present before for any package with more than 1 .go file, but it's increased when some files have renamed imports (since they're typically used to resolve shadowing conflicts). Resolves TODO(adonovan): support renaming imports. Change-Id: Ie0e702345790fd2059c229623fb99fe645d688a4 Reviewed-on: https://go-review.googlesource.com/23785 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Alan Donovan <adonovan@google.com>
44 lines
570 B
Plaintext
44 lines
570 B
Plaintext
// Code generated by golang.org/x/tools/cmd/bundle.
|
|
// $ bundle
|
|
|
|
// The package doc comment
|
|
//
|
|
|
|
package dest
|
|
|
|
import (
|
|
"fmt"
|
|
. "fmt"
|
|
_ "fmt"
|
|
renamedfmt "fmt"
|
|
renamedfmt2 "fmt"
|
|
|
|
"domain.name/importdecl"
|
|
)
|
|
|
|
// init functions are not renamed
|
|
func init() { prefixfoo() }
|
|
|
|
// Type S.
|
|
type prefixS struct {
|
|
prefixt
|
|
u int
|
|
}
|
|
|
|
// Function bar.
|
|
func prefixbar(s *prefixS) { fmt.Println(s.prefixt, s.u) }
|
|
|
|
type prefixt int
|
|
|
|
const prefixc = 1
|
|
|
|
func prefixfoo() {
|
|
fmt.Println(importdecl.F())
|
|
}
|
|
|
|
func prefixbaz() {
|
|
renamedfmt.Println()
|
|
renamedfmt2.Println()
|
|
Println()
|
|
}
|