g3n / engine

Go 3D Game Engine (http://g3n.rocks)
https://discord.gg/NfaeVr8zDg
BSD 2-Clause "Simplified" License
2.79k stars 295 forks source link

Installation error due to formatting #235

Closed SamTov closed 3 years ago

SamTov commented 3 years ago

System

It seems that there is an error with the audio directory file listener-browser. When I run the install as GOOS=js GOARCH=wasm go install ./... I get the following

# github.com/g3n/engine/audio
audio/listener-browser.go:44:1: missing return at end of function
audio/listener-browser.go:50:1: missing return at end of function
audio/listener-browser.go:62:1: missing return at end of function

If I then remove these methods as they are all under a //TODO comment I will get the error

audio/listener-browser.go:11:2: imported and not used: "github.com/g3n/engine/gls"
audio/listener-browser.go:12:2: imported and not used: "github.com/g3n/engine/math32"

Removing the imports results in a build with no comments. I am somewhat unsure of how successfully the build is as there are no comments at all. Perhaps having some messaging to say that a build was successful would be helpful.

Also, I am unsure if this install error is unique to me, but if not, would it be better to put this listener-browser stuff into its own branch?

danaugrs commented 3 years ago

Hi! g3n doesn't fully support js/wasm yet. IIRC the last time I was working on it everything was working except audio.

Removing the imports results in a build with no comments. I am somewhat unsure of how successfully the build is as there are no comments at all. Perhaps having some messaging to say that a build was successful would be helpful.

Here I'm assuming you mean that there is no log output in the console. That's the normal behavior of the go build command when the build is successful. You can go build -v (verbose) to see more information about what's being built and in which order.

If you want to work on fixing audio for js/wasm, the idea is to create a minimal cross-platform audio API that works natively and in the browser. Feel free to send pull requests :smile:

SamTov commented 3 years ago

I'd definitely be interested. I'll need to do some digging for a while first though.

danaugrs commented 3 years ago

Closing to consolidate WebAssembly discussion in https://github.com/g3n/engine/issues/114.