g3n/engine

Installation error due to formatting

Closed this issue · 3 comments

System

  • Mac intel 64
  • Darwin 20.4.0

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?

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 😄

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

Closing to consolidate WebAssembly discussion in #114.