asticode / go-astilectron-demo

Discover the power of Astilectron through a demo app
MIT License
404 stars 83 forks source link

Error building #18

Closed matejp closed 6 years ago

matejp commented 6 years ago

~/go/src/github.com/asticode/go-astilectron-demo$ astilectron-bundler -v

DEBU[0000] Resetting
DEBU[0000] Creating /tmp/astibundler
DEBU[0000] Creating /home/matej/go/src/github.com/asticode/go-astilectron-demo/output DEBU[0000] Bundling for environment linux/amd64
DEBU[0000] Removing /home/matej/go/src/github.com/asticode/go-astilectron-demo/output/linux-amd64 DEBU[0000] Creating /home/matej/go/src/github.com/asticode/go-astilectron-demo/output/linux-amd64 DEBU[0000] Binding data
DEBU[0000] Removing /home/matej/go/src/github.com/asticode/go-astilectron-demo/vendor_astilectron_bundler DEBU[0000] Creating /home/matej/go/src/github.com/asticode/go-astilectron-demo/vendor_astilectron_bundler DEBU[0000] Downloading https://github.com/asticode/astilectron/archive/v0.14.0.zip into /tmp/astibundler/astilectron-0.14.0.zip DEBU[0000] Copying /tmp/astibundler/astilectron-0.14.0.zip to /home/matej/go/src/github.com/asticode/go-astilectron-demo/vendor_astilectron_bundler/astilectron.zip DEBU[0000] Downloading https://github.com/electron/electron/releases/download/v1.8.1/electron-v1.8.1-linux-x64.zip into /tmp/astibundler/electron-linux-amd64-1.8.1.zip DEBU[0005] Copying /tmp/astibundler/electron-linux-amd64-1.8.1.zip to /home/matej/go/src/github.com/asticode/go-astilectron-demo/vendor_astilectron_bundler/electron.zip DEBU[0005] Generating /home/matej/go/src/github.com/asticode/go-astilectron-demo/bind_linux_amd64.go DEBU[0009] Building for os linux and arch amd64
DEBU[0009] Executing go build -ldflags -s -X "main.AppName=Astilectron demo" -X "main.BuiltAt=2018-01-05 14:16:20.806813048 +0100 CET m=+9.011520437" -o /home/matej/go/src/github.com/asticode/go-astilectron-demo/output/linux-amd64/binary github.com/asticode/go-astilectron-demo

FATA[0013] bundling failed: bundling for environment linux/amd64 failed: building failed: # github.com/asticode/go-astilectron-demo ./bind_linux_amd64.go:537:34: Asset redeclared in this block previous declaration at ./bind.go:3:34 ./bind_linux_amd64.go:728:38: RestoreAssets redeclared in this block previous declaration at ./bind.go:7:38 : exit status 2

Ran this on: Distributor ID: Ubuntu Description: Ubuntu 17.04 Release: 17.04 Codename: zesty

go version go1.9 linux/amd64

If you need any more information or if I can help let me know.

asticode commented 6 years ago

@matejp did you do rm $GOPATH/src/github.com/asticode/go-astilectron-demo/bind.go like the README.md mentions?

matejp commented 6 years ago

No I didn't. Now it works. Thank you.

Can you explain why this is needed, please. I am trying to learn how to use Astilectron. Or just point me to the documentation.

Thank you for your time.

asticode commented 6 years ago

@matejp this is not something that is mandatory because of Astilectron.

Basically, when you execute go get github.com/asticode/go-astilectron-demo the code in the repo has to be valid or it will fail.

In the repo, the following methods are called: Asset and RestoreAssets. Therefore they must be present in the repo. Unfortunately they are methods that are generated by the bundler. Therefore I had to add some dummy one in the repo in the bind.go file just to fix the go get command.

As soon as the go get is done, you can get rid of the bind.go file.

Does it make sense ?

matejp commented 6 years ago

@asticode Yes thank you.