patch: fmt, os, runtime, syscall, time
This commit is contained in:
@@ -20,3 +20,17 @@ package runtime
|
||||
import (
|
||||
_ "unsafe"
|
||||
)
|
||||
|
||||
// GOROOT returns the root of the Go tree. It uses the
|
||||
// GOROOT environment variable, if set at process start,
|
||||
// or else the root used during the Go build.
|
||||
func GOROOT() string {
|
||||
/*
|
||||
s := gogetenv("GOROOT")
|
||||
if s != "" {
|
||||
return s
|
||||
}
|
||||
return defaultGOROOT
|
||||
*/
|
||||
panic("todo: GOROOT")
|
||||
}
|
||||
|
||||
30
internal/lib/runtime/zgoarch_386.go
Normal file
30
internal/lib/runtime/zgoarch_386.go
Normal file
@@ -0,0 +1,30 @@
|
||||
//go:build 386
|
||||
|
||||
package runtime
|
||||
|
||||
const GOARCH = `386`
|
||||
|
||||
const Is386 = 1
|
||||
const IsAmd64 = 0
|
||||
const IsAmd64p32 = 0
|
||||
const IsArm = 0
|
||||
const IsArmbe = 0
|
||||
const IsArm64 = 0
|
||||
const IsArm64be = 0
|
||||
const IsLoong64 = 0
|
||||
const IsMips = 0
|
||||
const IsMipsle = 0
|
||||
const IsMips64 = 0
|
||||
const IsMips64le = 0
|
||||
const IsMips64p32 = 0
|
||||
const IsMips64p32le = 0
|
||||
const IsPpc = 0
|
||||
const IsPpc64 = 0
|
||||
const IsPpc64le = 0
|
||||
const IsRiscv = 0
|
||||
const IsRiscv64 = 0
|
||||
const IsS390 = 0
|
||||
const IsS390x = 0
|
||||
const IsSparc = 0
|
||||
const IsSparc64 = 0
|
||||
const IsWasm = 0
|
||||
30
internal/lib/runtime/zgoarch_amd64.go
Normal file
30
internal/lib/runtime/zgoarch_amd64.go
Normal file
@@ -0,0 +1,30 @@
|
||||
//go:build amd64
|
||||
|
||||
package runtime
|
||||
|
||||
const GOARCH = `amd64`
|
||||
|
||||
const Is386 = 0
|
||||
const IsAmd64 = 1
|
||||
const IsAmd64p32 = 0
|
||||
const IsArm = 0
|
||||
const IsArmbe = 0
|
||||
const IsArm64 = 0
|
||||
const IsArm64be = 0
|
||||
const IsLoong64 = 0
|
||||
const IsMips = 0
|
||||
const IsMipsle = 0
|
||||
const IsMips64 = 0
|
||||
const IsMips64le = 0
|
||||
const IsMips64p32 = 0
|
||||
const IsMips64p32le = 0
|
||||
const IsPpc = 0
|
||||
const IsPpc64 = 0
|
||||
const IsPpc64le = 0
|
||||
const IsRiscv = 0
|
||||
const IsRiscv64 = 0
|
||||
const IsS390 = 0
|
||||
const IsS390x = 0
|
||||
const IsSparc = 0
|
||||
const IsSparc64 = 0
|
||||
const IsWasm = 0
|
||||
30
internal/lib/runtime/zgoarch_arm64.go
Normal file
30
internal/lib/runtime/zgoarch_arm64.go
Normal file
@@ -0,0 +1,30 @@
|
||||
//go:build arm64
|
||||
|
||||
package runtime
|
||||
|
||||
const GOARCH = `arm64`
|
||||
|
||||
const Is386 = 0
|
||||
const IsAmd64 = 0
|
||||
const IsAmd64p32 = 0
|
||||
const IsArm = 0
|
||||
const IsArmbe = 0
|
||||
const IsArm64 = 1
|
||||
const IsArm64be = 0
|
||||
const IsLoong64 = 0
|
||||
const IsMips = 0
|
||||
const IsMipsle = 0
|
||||
const IsMips64 = 0
|
||||
const IsMips64le = 0
|
||||
const IsMips64p32 = 0
|
||||
const IsMips64p32le = 0
|
||||
const IsPpc = 0
|
||||
const IsPpc64 = 0
|
||||
const IsPpc64le = 0
|
||||
const IsRiscv = 0
|
||||
const IsRiscv64 = 0
|
||||
const IsS390 = 0
|
||||
const IsS390x = 0
|
||||
const IsSparc = 0
|
||||
const IsSparc64 = 0
|
||||
const IsWasm = 0
|
||||
30
internal/lib/runtime/zgoarch_wasm.go
Normal file
30
internal/lib/runtime/zgoarch_wasm.go
Normal file
@@ -0,0 +1,30 @@
|
||||
//go:build wasm
|
||||
|
||||
package runtime
|
||||
|
||||
const GOARCH = `wasm`
|
||||
|
||||
const Is386 = 0
|
||||
const IsAmd64 = 0
|
||||
const IsAmd64p32 = 0
|
||||
const IsArm = 0
|
||||
const IsArmbe = 0
|
||||
const IsArm64 = 0
|
||||
const IsArm64be = 0
|
||||
const IsLoong64 = 0
|
||||
const IsMips = 0
|
||||
const IsMipsle = 0
|
||||
const IsMips64 = 0
|
||||
const IsMips64le = 0
|
||||
const IsMips64p32 = 0
|
||||
const IsMips64p32le = 0
|
||||
const IsPpc = 0
|
||||
const IsPpc64 = 0
|
||||
const IsPpc64le = 0
|
||||
const IsRiscv = 0
|
||||
const IsRiscv64 = 0
|
||||
const IsS390 = 0
|
||||
const IsS390x = 0
|
||||
const IsSparc = 0
|
||||
const IsSparc64 = 0
|
||||
const IsWasm = 1
|
||||
24
internal/lib/runtime/zgoos_android.go
Normal file
24
internal/lib/runtime/zgoos_android.go
Normal file
@@ -0,0 +1,24 @@
|
||||
//go:build android
|
||||
|
||||
package runtime
|
||||
|
||||
const GOOS = `android`
|
||||
|
||||
const IsAix = 0
|
||||
const IsAndroid = 1
|
||||
const IsDarwin = 0
|
||||
const IsDragonfly = 0
|
||||
const IsFreebsd = 0
|
||||
const IsHurd = 0
|
||||
const IsIllumos = 0
|
||||
const IsIos = 0
|
||||
const IsJs = 0
|
||||
const IsLinux = 0
|
||||
const IsNacl = 0
|
||||
const IsNetbsd = 0
|
||||
const IsOpenbsd = 0
|
||||
const IsPlan9 = 0
|
||||
const IsSolaris = 0
|
||||
const IsWasip1 = 0
|
||||
const IsWindows = 0
|
||||
const IsZos = 0
|
||||
24
internal/lib/runtime/zgoos_darwin.go
Normal file
24
internal/lib/runtime/zgoos_darwin.go
Normal file
@@ -0,0 +1,24 @@
|
||||
//go:build !ios && darwin
|
||||
|
||||
package runtime
|
||||
|
||||
const GOOS = `darwin`
|
||||
|
||||
const IsAix = 0
|
||||
const IsAndroid = 0
|
||||
const IsDarwin = 1
|
||||
const IsDragonfly = 0
|
||||
const IsFreebsd = 0
|
||||
const IsHurd = 0
|
||||
const IsIllumos = 0
|
||||
const IsIos = 0
|
||||
const IsJs = 0
|
||||
const IsLinux = 0
|
||||
const IsNacl = 0
|
||||
const IsNetbsd = 0
|
||||
const IsOpenbsd = 0
|
||||
const IsPlan9 = 0
|
||||
const IsSolaris = 0
|
||||
const IsWasip1 = 0
|
||||
const IsWindows = 0
|
||||
const IsZos = 0
|
||||
24
internal/lib/runtime/zgoos_ios.go
Normal file
24
internal/lib/runtime/zgoos_ios.go
Normal file
@@ -0,0 +1,24 @@
|
||||
//go:build ios
|
||||
|
||||
package runtime
|
||||
|
||||
const GOOS = `ios`
|
||||
|
||||
const IsAix = 0
|
||||
const IsAndroid = 0
|
||||
const IsDarwin = 0
|
||||
const IsDragonfly = 0
|
||||
const IsFreebsd = 0
|
||||
const IsHurd = 0
|
||||
const IsIllumos = 0
|
||||
const IsIos = 1
|
||||
const IsJs = 0
|
||||
const IsLinux = 0
|
||||
const IsNacl = 0
|
||||
const IsNetbsd = 0
|
||||
const IsOpenbsd = 0
|
||||
const IsPlan9 = 0
|
||||
const IsSolaris = 0
|
||||
const IsWasip1 = 0
|
||||
const IsWindows = 0
|
||||
const IsZos = 0
|
||||
24
internal/lib/runtime/zgoos_js.go
Normal file
24
internal/lib/runtime/zgoos_js.go
Normal file
@@ -0,0 +1,24 @@
|
||||
//go:build js
|
||||
|
||||
package runtime
|
||||
|
||||
const GOOS = `js`
|
||||
|
||||
const IsAix = 0
|
||||
const IsAndroid = 0
|
||||
const IsDarwin = 0
|
||||
const IsDragonfly = 0
|
||||
const IsFreebsd = 0
|
||||
const IsHurd = 0
|
||||
const IsIllumos = 0
|
||||
const IsIos = 0
|
||||
const IsJs = 1
|
||||
const IsLinux = 0
|
||||
const IsNacl = 0
|
||||
const IsNetbsd = 0
|
||||
const IsOpenbsd = 0
|
||||
const IsPlan9 = 0
|
||||
const IsSolaris = 0
|
||||
const IsWasip1 = 0
|
||||
const IsWindows = 0
|
||||
const IsZos = 0
|
||||
24
internal/lib/runtime/zgoos_linux.go
Normal file
24
internal/lib/runtime/zgoos_linux.go
Normal file
@@ -0,0 +1,24 @@
|
||||
//go:build !android && linux
|
||||
|
||||
package runtime
|
||||
|
||||
const GOOS = `linux`
|
||||
|
||||
const IsAix = 0
|
||||
const IsAndroid = 0
|
||||
const IsDarwin = 0
|
||||
const IsDragonfly = 0
|
||||
const IsFreebsd = 0
|
||||
const IsHurd = 0
|
||||
const IsIllumos = 0
|
||||
const IsIos = 0
|
||||
const IsJs = 0
|
||||
const IsLinux = 1
|
||||
const IsNacl = 0
|
||||
const IsNetbsd = 0
|
||||
const IsOpenbsd = 0
|
||||
const IsPlan9 = 0
|
||||
const IsSolaris = 0
|
||||
const IsWasip1 = 0
|
||||
const IsWindows = 0
|
||||
const IsZos = 0
|
||||
24
internal/lib/runtime/zgoos_windows.go
Normal file
24
internal/lib/runtime/zgoos_windows.go
Normal file
@@ -0,0 +1,24 @@
|
||||
//go:build windows
|
||||
|
||||
package runtime
|
||||
|
||||
const GOOS = `windows`
|
||||
|
||||
const IsAix = 0
|
||||
const IsAndroid = 0
|
||||
const IsDarwin = 0
|
||||
const IsDragonfly = 0
|
||||
const IsFreebsd = 0
|
||||
const IsHurd = 0
|
||||
const IsIllumos = 0
|
||||
const IsIos = 0
|
||||
const IsJs = 0
|
||||
const IsLinux = 0
|
||||
const IsNacl = 0
|
||||
const IsNetbsd = 0
|
||||
const IsOpenbsd = 0
|
||||
const IsPlan9 = 0
|
||||
const IsSolaris = 0
|
||||
const IsWasip1 = 0
|
||||
const IsWindows = 1
|
||||
const IsZos = 0
|
||||
Reference in New Issue
Block a user