Skip to content

Commit

Permalink
feat: support non arm or amd arch (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
joway authored Sep 16, 2024
1 parent 703b2a9 commit 336bc1d
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
2 changes: 2 additions & 0 deletions runtimex.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//go:build arm64 || amd64

// Copyright 2024 CloudWeGo Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
32 changes: 32 additions & 0 deletions runtimex_other.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
//go:build !(arm64 || amd64)

// Copyright 2024 CloudWeGo Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

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
}

0 comments on commit 336bc1d

Please sign in to comment.