console icon indicating copy to clipboard operation
console copied to clipboard

fix: add shim for js

Open paralin opened this issue 4 years ago • 8 comments

Fixes build with:

env GOOS=js GOARCH=wasm go build -trimpath .

paralin avatar Jan 04 '22 23:01 paralin

How is this expected to be used?

AkihiroSuda avatar Jan 05 '22 16:01 AkihiroSuda

It's a shim so that programs built using the console package can compile against GOOS=js as well.

paralin avatar Jan 05 '22 20:01 paralin

@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 avatar Jan 07 '22 23:01 dmcgowan

@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 avatar Jan 07 '22 23:01 paralin

@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 avatar Jan 10 '22 20:01 dmcgowan

@dmcgowan okay, applied the change.

paralin avatar Jan 11 '22 01:01 paralin

As mentioned in the conversation - the license checker fails if formatted with go 1.17

paralin avatar Jan 16 '22 02:01 paralin

I updated the linters and licence-checker in https://github.com/containerd/console/pull/61, and formatted with go1.17

thaJeztah avatar Feb 11 '22 14:02 thaJeztah

@thaJeztah @AkihiroSuda Fixed & rebased, apologies for the delay!

paralin avatar May 26 '23 08:05 paralin