os: use goarch.BigEndian

Change-Id: I83c23ae0933f6abe4c07144f69c3d9c18aece6e8
Reviewed-on: https://go-review.googlesource.com/c/go/+/569175
Auto-Submit: Ian Lance Taylor <iant@google.com>
Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
This commit is contained in:
Tobias Klauser 2024-03-05 10:54:22 +01:00 committed by Gopher Robot
parent 1a800d1c88
commit 80a91d34f4
3 changed files with 2 additions and 19 deletions

View File

@ -7,6 +7,7 @@
package os
import (
"internal/goarch"
"io"
"runtime"
"sync"
@ -153,7 +154,7 @@ func readInt(b []byte, off, size uintptr) (u uint64, ok bool) {
if len(b) < int(off+size) {
return 0, false
}
if isBigEndian {
if goarch.BigEndian {
return readIntBE(b[off:], size), true
}
return readIntLE(b[off:], size), true

View File

@ -1,9 +0,0 @@
// Copyright 2016 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//
//go:build ppc64 || s390x || mips || mips64
package os
const isBigEndian = true

View File

@ -1,9 +0,0 @@
// Copyright 2016 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//
//go:build 386 || amd64 || arm || arm64 || loong64 || ppc64le || mips64le || mipsle || riscv64 || wasm
package os
const isBigEndian = false