Skip to content
This repository was archived by the owner on Mar 25, 2026. It is now read-only.
This repository was archived by the owner on Mar 25, 2026. It is now read-only.

incorrect-looking // +build line #261

@rsc

Description

@rsc

I've been analyzing // +build usage in the Go ecosystem and turned up dom_wasmjs_gopherjs.go, which says:

// +build go1.12,wasm,js js

and dom_native.go which says:

// +build go1.12,!wasm,!js

These two conditions are:

dom_wasmjs_gopherjs.go: (go1.12 && wasm && js) || js which is a complex way of writing js.
dom_native.go: go1.12 && !wasm && !js

I am unsure about what exactly is intended here. From the comments in dom_native.go, it looks like the intent was for dom_wasmjs_gopherjs.go to apply to js/wasm builds and dom_native.go to apply otherwise. That would be:

dom_wasmjs_gopherjs.go: go1.12 && js && wasm

// +build go1.12,js,wasm

dom_native.go: !(go1.12 && js && wasm) which is !go1.12 || !js || !wasm

// +build !go1.12 !js !wasm

Best,
Russ

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions