danalex97 / Speer

A network discrete event simulator for peer-to-peer network modeling.
MIT License
14 stars 3 forks source link

Examples don't run #55

Open cornfeedhobo opened 5 years ago

cornfeedhobo commented 5 years ago

Bug report template:

Bug description

Every included example fails to run.

To Reproduce

`go run speer.go -config=examples/config/sink.json`

``` panic: Failed finding entry point. [recovered] panic: Failed finding entry point. [recovered] panic: Failed finding entry point. goroutine 1 [running]: github.com/danalex97/Speer/config.NewSimulation.func1() /home/cornfeedhobo/go/src/github.com/danalex97/Speer/config/simulation.go:67 +0x6b panic(0x525380, 0x5790e0) /usr/lib64/go/1.9/src/runtime/panic.go:491 +0x283 github.com/danalex97/Speer/config.CreateTemplate.func1() /home/cornfeedhobo/go/src/github.com/danalex97/Speer/config/template.go:38 +0x6b panic(0x525380, 0x5790e0) /usr/lib64/go/1.9/src/runtime/panic.go:491 +0x283 github.com/danalex97/Speer/config.CreateStub(0xc420018400, 0x34) /home/cornfeedhobo/go/src/github.com/danalex97/Speer/config/template.go:73 +0x59d github.com/danalex97/Speer/config.CreateTemplate(0xc4200c4000) /home/cornfeedhobo/go/src/github.com/danalex97/Speer/config/template.go:46 +0x74 github.com/danalex97/Speer/config.NewSimulation(0xc4200c4000, 0x0, 0x0) /home/cornfeedhobo/go/src/github.com/danalex97/Speer/config/simulation.go:72 +0x89 main.main() /home/cornfeedhobo/go/src/github.com/danalex97/Speer/speer.go:84 +0x179 exit status 2 ```

`go run speer.go -config=examples/config/broadcast.json`

``` panic: Failed finding entry point. [recovered] panic: Failed finding entry point. [recovered] panic: Failed finding entry point. goroutine 1 [running]: github.com/danalex97/Speer/config.NewSimulation.func1() /home/cornfeedhobo/go/src/github.com/danalex97/Speer/config/simulation.go:67 +0x6b panic(0x525380, 0x5790e0) /usr/lib64/go/1.9/src/runtime/panic.go:491 +0x283 github.com/danalex97/Speer/config.CreateTemplate.func1() /home/cornfeedhobo/go/src/github.com/danalex97/Speer/config/template.go:38 +0x6b panic(0x525380, 0x5790e0) /usr/lib64/go/1.9/src/runtime/panic.go:491 +0x283 github.com/danalex97/Speer/config.CreateStub(0xc420018400, 0x3e) /home/cornfeedhobo/go/src/github.com/danalex97/Speer/config/template.go:73 +0x59d github.com/danalex97/Speer/config.CreateTemplate(0xc4200be000) /home/cornfeedhobo/go/src/github.com/danalex97/Speer/config/template.go:46 +0x74 github.com/danalex97/Speer/config.NewSimulation(0xc4200be000, 0x0, 0x0) /home/cornfeedhobo/go/src/github.com/danalex97/Speer/config/simulation.go:72 +0x89 main.main() /home/cornfeedhobo/go/src/github.com/danalex97/Speer/speer.go:84 +0x179 exit status 2 ```

`go run speer.go -config=examples/config/data_link.json`

``` panic: Failed finding entry point. [recovered] panic: Failed finding entry point. [recovered] panic: Failed finding entry point. goroutine 1 [running]: github.com/danalex97/Speer/config.NewSimulation.func1() /home/cornfeedhobo/go/src/github.com/danalex97/Speer/config/simulation.go:67 +0x6b panic(0x525380, 0x5790e0) /usr/lib64/go/1.9/src/runtime/panic.go:491 +0x283 github.com/danalex97/Speer/config.CreateTemplate.func1() /home/cornfeedhobo/go/src/github.com/danalex97/Speer/config/template.go:38 +0x6b panic(0x525380, 0x5790e0) /usr/lib64/go/1.9/src/runtime/panic.go:491 +0x283 github.com/danalex97/Speer/config.CreateStub(0xc420018400, 0x3d) /home/cornfeedhobo/go/src/github.com/danalex97/Speer/config/template.go:73 +0x59d github.com/danalex97/Speer/config.CreateTemplate(0xc4200ba000) /home/cornfeedhobo/go/src/github.com/danalex97/Speer/config/template.go:46 +0x74 github.com/danalex97/Speer/config.NewSimulation(0xc4200ba000, 0x0, 0x0) /home/cornfeedhobo/go/src/github.com/danalex97/Speer/config/simulation.go:72 +0x89 main.main() /home/cornfeedhobo/go/src/github.com/danalex97/Speer/speer.go:84 +0x179 exit status 2 ```

cornfeedhobo commented 5 years ago

I figured it out. GOPATH supports a colon deliminated list of paths to search, but speer ignores this. Instead, speer should be searching this list for the first match.

danalex97 commented 4 years ago

@cornfeedhobo Thanks for filing the issue and for figuring out the problem. Will put a commit for it(unless you want to put a PR for it :smile:).