petergtz / pegomock

Pegomock is a powerful, yet simple mocking framework for the Go programming language
Apache License 2.0
252 stars 28 forks source link

Project structure broken #38

Closed berupp closed 7 years ago

berupp commented 7 years ago

Hey Peter,

I think you accidentally broke the code recently

prog.go:11:2: cannot find package "github.com/petergtz/pegomock/pegomock/mockgen/model" in any of:
        /usr/local/go/src/github.com/petergtz/pegomock/pegomock/mockgen/model (from $GOROOT)
        /localdisk/gowork/src/github.com/petergtz/pegomock/pegomock/mockgen/model (from $GOPATH)

goroutine 1 [running]:
panic(0x34c520, 0xc8200bc500)
        /usr/local/go/src/runtime/panic.go:464 +0x3e6
github.com/petergtz/pegomock/pegomock/mockgen.GenerateMockSourceCode(0xc8200c8340, 0x2, 0x2, 0xc8200bc0a0, 0xa, 0x0, 0x0, 0x0, 0x6be340, 0xc82002c018, ...)
        /localdisk/gowork/src/github.com/petergtz/pegomock/pegomock/mockgen/mockgen.go:96 +0x313
github.com/petergtz/pegomock/pegomock/mockgen.GenerateMockFile(0xc8200c8340, 0x2, 0x2, 0xc8200ca0c0, 0x59, 0xc8200bc0a0, 0xa, 0x0, 0x0, 0x0, ...)
        /localdisk/gowork/src/github.com/petergtz/pegomock/pegomock/mockgen/mockgen.go:72 +0xa4
github.com/petergtz/pegomock/pegomock/mockgen.GenerateMockFileInOutputDir(0xc8200c8340, 0x2, 0x2, 0xc820014044, 0x3b, 0x0, 0x0, 0xc8200bc0a0, 0xa, 0x0, ...)
        /localdisk/gowork/src/github.com/petergtz/pegomock/pegomock/mockgen/mockgen.go:58 +0x113
main.Run(0xc82000a180, 0x3, 0x3, 0x6be340, 0xc82002c018, 0xc8200c6000, 0xc8200ca000)
        /localdisk/gowork/src/github.com/petergtz/pegomock/pegomock/main.go:78 +0x1818
main.main()
        /localdisk/gowork/src/github.com/petergtz/pegomock/pegomock/main.go:35 +0xa1

I removed and re-fetched pegomock to make sure its nothing local. Had no time to look into it but judging from the last commit comment I assume some code got refactored and something was missed.

Ben

berupp commented 7 years ago

My bad, Had to build with go install github.com/petergtz/pegomock/pegomock

petergtz commented 7 years ago

Glad everything still works. Note though, there was a minor breaking change in the API. The methods GetCapturedArguments and GetAllCapturedArguments are now with an upper case G to make them export proberly when the mock lives in a different package than the test (I wouldn't recommend the latter, but just in case).

I haven't found a good way yet to communicate such changes yet, but simply trust that people will open issues (like you did) when they run into problems for things like this.