diff --git a/runtimex.go b/runtimex.go index 6fb5a87..057eef3 100644 --- a/runtimex.go +++ b/runtimex.go @@ -1,3 +1,5 @@ +//go:build arm64 || amd64 + // Copyright 2024 CloudWeGo Authors // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/runtimex_other.go b/runtimex_other.go new file mode 100644 index 0000000..194598b --- /dev/null +++ b/runtimex_other.go @@ -0,0 +1,18 @@ +//go:build !(arm64 || amd64) + +package runtimex + +import ( + "fmt" + "runtime" +) + +var ErrUnimplemented = fmt.Errorf("runtimex: unimplemented in this platform[%s]", runtime.GOARCH) + +func GID() (int, error) { + return 0, ErrUnimplemented +} + +func PID() (int, error) { + return 0, ErrUnimplemented +}