Skip to content

cwriter: add the blank wasm util and writer for building pass - #132

Open
Icemap wants to merge 2 commits into
vbauerster:masterfrom
Icemap:feat-cwriter-for-wasm
Open

cwriter: add the blank wasm util and writer for building pass#132
Icemap wants to merge 2 commits into
vbauerster:masterfrom
Icemap:feat-cwriter-for-wasm

Conversation

@Icemap

@Icemap Icemap commented Nov 10, 2023

Copy link
Copy Markdown

No description provided.

@Solaris-star Solaris-star left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reading this together with #133 — both add WASM/js build stubs for cwriter.

This PR (#132) uses the modern //go:build syntax which is correct for Go 1.17+. However, IsTerminal returning true unconditionally is misleading — in a WASM context there is no terminal, so returning false (and letting callers fall back to non-TTY output) would be more honest. GetSize returning (0, 0, nil) is fine.

The empty Writer struct with a no-op Flush is the right approach.

Since #133 is a superset of this (it also adds util_wasm.go with the ioctl const), I'd suggest consolidating into one PR. The //+build (old syntax) in #133 should be updated to //go:build to match this one.

This was referenced Jul 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants