diff options
| author | Brad Fitzpatrick <bradfitz@golang.org> | 2026-03-02 09:40:12 -0800 |
|---|---|---|
| committer | Brad Fitzpatrick <bradfitz@golang.org> | 2026-03-02 18:43:01 -0800 |
| commit | b5c2bd7e050ceb00b1f240d8759e1ed9ebcfa4c7 (patch) | |
| tree | 2e2dbb28d377335b8830f97489af76547f891ec6 /src/syscall | |
| parent | 033b11f257e256a8a24d575fa92a3bb3a46e1178 (diff) | |
| download | go-b5c2bd7e050ceb00b1f240d8759e1ed9ebcfa4c7.tar.xz | |
syscall: define no-op Errno type on plan9
Go's api/go1.txt's has line "pkg syscall, type Errno uintptr",
suggesting people should assume this type always exists. It does
for GOOS=js GOARCH=wasm too, which was also added later.
Adding this here lets portable code be written without build-tagged
files, using runtime.GOOS checks instead.
Change-Id: I785a19ec104d2ac34b55a96b5a342bcc33712961
Reviewed-on: https://go-review.googlesource.com/c/go/+/750680
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Damien Neil <dneil@google.com>
Reviewed-by: David Chase <drchase@google.com>
Diffstat (limited to 'src/syscall')
| -rw-r--r-- | src/syscall/syscall_plan9.go | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/syscall/syscall_plan9.go b/src/syscall/syscall_plan9.go index 968782008d..7a130907dd 100644 --- a/src/syscall/syscall_plan9.go +++ b/src/syscall/syscall_plan9.go @@ -21,6 +21,15 @@ import ( const ImplementsGetwd = true const bitSize16 = 2 +// Errno is not used with GOOS plan9. +// +// It exists because because the Go 1 API contract +// (api/go1.txt's "pkg syscall, type Errno uintptr") +// says it exists, and so code in the ecosystem often +// assume it exists. This lets portable code be written +// without build-tagged files, using runtime.GOOS checks instead. +type Errno uintptr + // ErrorString implements Error's String method by returning itself. // // ErrorString values can be tested against error values using [errors.Is]. |
