clipperhouse / gen

Type-driven code generation for Go
http://clipperhouse.com/gen/overview/
Other
1.43k stars 90 forks source link

gen panics #71

Closed davewhat closed 10 years ago

davewhat commented 10 years ago

Hi. Not quite sure what is going on here. I'm using go 1.3.3 on a very very simple file:

main.go

package main

import "fmt"

// +gen type MyStruct struct { Name string }

func main() { fmt.Println("hello world")

}

Any thoughts??? Much appreciated.

panic: no Config.Import or DefaultImport (missing import "golang.org/x/tools/go/gcimporter"?) [recovered] panic: no Config.Import or DefaultImport (missing import "golang.org/x/tools/go/gcimporter"?)

goroutine 16 [running]: runtime.panic(0x244380, 0x2085dcc00) /usr/local/Cellar/go/1.3.3/libexec/src/pkg/runtime/panic.c:279 +0xf5 code.google.com/p/go.tools/go/types.(_Checker).handleBailout(0x208614f70, 0x220878e7f8) /Users/dw/Documents/Code/getfastbar.server/src/code.google.com/p/go.tools/go/types/check.go:218 +0xcd runtime.panic(0x244380, 0x2085dcc00) /usr/local/Cellar/go/1.3.3/libexec/src/pkg/runtime/panic.c:248 +0x18d code.google.com/p/go.tools/go/types.(_Checker).collectObjects(0x208614f70) /Users/dw/Documents/Code/getfastbar.server/src/code.google.com/p/go.tools/go/types/resolver.go:134 +0xb0 code.google.com/p/go.tools/go/types.(_Checker).Files(0x208614f70, 0x208628130, 0x1, 0x1, 0x0, 0x0) /Users/dw/Documents/Code/getfastbar.server/src/code.google.com/p/go.tools/go/types/check.go:228 +0xb7 code.google.com/p/go.tools/go/types.(_Config).Check(0x208684540, 0x2085dca40, 0x4, 0x208627240, 0x208628130, 0x1, 0x1, 0x0, 0x23932, 0x0, ...) /Users/dw/Documents/Code/getfastbar.server/src/code.google.com/p/go.tools/go/types/api.go:336 +0xbf code.google.com/p/go.tools/go/types.Check(0x2085dca40, 0x4, 0x208627240, 0x208628130, 0x1, 0x1, 0x0, 0x0, 0x0) /Users/dw/Documents/Code/getfastbar.server/src/code.google.com/p/go.tools/go/types/api.go:42 +0xa2 github.com/clipperhouse/gen/typewriter.getPackage(0x208627240, 0x2086844e0, 0x220878ec10, 0x0, 0x0) /Users/dw/Documents/Code/getfastbar.server/src/github.com/clipperhouse/gen/typewriter/package.go:29 +0x1e5 github.com/clipperhouse/gen/typewriter.getTypes(0x311640, 0x4, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0) /Users/dw/Documents/Code/getfastbar.server/src/github.com/clipperhouse/gen/typewriter/parse.go:24 +0x1e3 github.com/clipperhouse/gen/typewriter.NewAppFiltered(0x311640, 0x4, 0x0, 0x0, 0x0, 0x0) /Users/dw/Documents/Code/getfastbar.server/src/github.com/clipperhouse/gen/typewriter/app.go:37 +0x86 github.com/clipperhouse/gen/typewriter.NewApp(0x311640, 0x4, 0xffffffffffffffff, 0x0, 0x0) /Users/dw/Documents/Code/getfastbar.server/src/github.com/clipperhouse/gen/typewriter/app.go:28 +0x4c main.runStandard(0x0, 0x0) /Users/dw/Documents/Code/getfastbar.server/src/github.com/clipperhouse/gen/run.go:21 +0x54 main.execute(0x415218, 0x208684150, 0x3, 0x3, 0x41d0d0, 0x26b, 0x0, 0x0) /Users/dw/Documents/Code/getfastbar.server/src/github.com/clipperhouse/gen/execute.go:25 +0x195 main.run(0x0, 0x0) /Users/dw/Documents/Code/getfastbar.server/src/github.com/clipperhouse/gen/run.go:17 +0xa7 main.runMain(0x2085dc000, 0x1, 0x1, 0x0, 0x0) /Users/dw/Documents/Code/getfastbar.server/src/github.com/clipperhouse/gen/main.go:21 +0x44 main.main() /Users/dw/Documents/Code/getfastbar.server/src/github.com/clipperhouse/gen/main.go:15 +0x8d

clipperhouse commented 10 years ago

Thanks, it had to do with path changes here: https://groups.google.com/d/msg/golang-nuts/eD8dh3T9yyA/l5Ail-xfMiAJ

Should be ok now, please reinstall.