goose: use readable variable names
Names are inferred from types most of the time, but have a fallback for a non-named type. Names are now also disambiguated from symbols in the same scope. Reviewed-by: Tuo Shan <shantuo@google.com> Reviewed-by: Herbie Ong <herbie@google.com>
This commit is contained in:
24
internal/goose/testdata/NamingWorstCase/foo/foo.go
vendored
Normal file
24
internal/goose/testdata/NamingWorstCase/foo/foo.go
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
stdcontext "context"
|
||||
"fmt"
|
||||
"os"
|
||||
)
|
||||
|
||||
type context struct{}
|
||||
|
||||
func main() {
|
||||
c, err := inject(stdcontext.Background(), struct{}{})
|
||||
if err != nil {
|
||||
fmt.Println("ERROR:", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
fmt.Println(c)
|
||||
}
|
||||
|
||||
//goose:provide
|
||||
|
||||
func provide(ctx stdcontext.Context) (context, error) {
|
||||
return context{}, nil
|
||||
}
|
||||
Reference in New Issue
Block a user