ffjson
ffjson copied to clipboard
[go 1.5] Unable to run ffjson against application packages
Hi
Since i upgraded to go 1.5.2, whenever i try to run ffjson against a file that is on the "main" package i'm getting the following error:
$ ffjson foobar.go
Error: Go Run Failed for: /tmp/ffjson-inception167280481.go
STDOUT:
STDERR:
/tmp/ffjson-inception167280481.go:8:2: import "github.com/foo/bar/foobar" is a program, not an importable package
$ go version
go version go1.5.2 linux/amd64
foobar.go
package main
import "fmt"
type FooStruct struct {
Bar string `json:"bar"`
Buz int `json:"buz"`
}
func main() {
var foobarbuz FooStruct
foobarbuz.Buz = 42
fmt.Println(foobarbuz)
}
Any thoughts on adding this to the README? It's a pretty serious gotcha.
I looked into improving the error message, which would probably be my first preference, but I guess the error is thrown directly from the standard library.
Any workarounds or explanation of this issue?