fix: add shim for js
Fixes build with:
env GOOS=js GOARCH=wasm go build -trimpath .
How is this expected to be used?
It's a shim so that programs built using the console package can compile against GOOS=js as well.
@paralin can you add a little bit more context to this issue. We don't currently have any ongoing efforts to support GOOS=js or issues tracking it. Knowing more about the use case would be helpful.
@dmcgowan The bubbletea TUI packages import containerd/console. I recently submitted several PRs to projects adding shims so that the build will complete if GOOS=js and GOARCH=wasm with reasonable defaults.
I think it makes sense in general to make the package at least build cleanly with that GOOS. Even if the functions are all shims.
@paralin if this library is being used for a platform other than what is explicitly supported, our normal pattern is to include a console_other.go file which builds with ! statements of the supported platforms. The current change in console_js.go aren't specific to any platform.
@dmcgowan okay, applied the change.
As mentioned in the conversation - the license checker fails if formatted with go 1.17
I updated the linters and licence-checker in https://github.com/containerd/console/pull/61, and formatted with go1.17
@thaJeztah @AkihiroSuda Fixed & rebased, apologies for the delay!