Skip to content

Instantly share code, notes, and snippets.

@kalafut
Created October 11, 2015 19:15
Show Gist options
  • Save kalafut/a244177e06d320519536 to your computer and use it in GitHub Desktop.
Save kalafut/a244177e06d320519536 to your computer and use it in GitHub Desktop.
Sample file that will generate gorename errors
package main
// Running gorename -from example.go::Foo -to foo on this file will not work.
// There are multiple errors, but it appears that gorename stops after the first one.
//
// example.go:16:6: renaming this type "Foo" to "foo"
// example.go:21:6: conflicts with func in same block
//
// After commenting out or changing foo(), the errors moves down:
//
// example.go:16:6: renaming this type "Foo" to "foo"
// example.go:24:12: would cause this reference to become shadowed
// example.go:24:8: by this intervening var definition
//
// Fixing that function and things move to the same error in b()...
type Foo int
func main() {
}
func foo() {
}
func a(foo Foo) {
}
func b(foo Foo) {
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment