mirror of
https://github.com/golang/go.git
synced 2026-04-03 17:59:55 +09:00
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>
This commit is contained in:
@@ -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].
|
||||
|
||||
Reference in New Issue
Block a user