all: run go fmt

I ran go fmt to fix format on the entire repository.

Change-Id: I2f09166b6b8ba0ffb0ba27f6500efb0ea4cf21ff
Reviewed-on: https://go-review.googlesource.com/c/go/+/566835
Reviewed-by: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Carlos Amedee <carlos@golang.org>
Auto-Submit: Ian Lance Taylor <iant@golang.org>
This commit is contained in:
sivchari 2024-02-26 14:59:15 +09:00 committed by Gopher Robot
parent 5d4c6088be
commit a05ea985c5
8 changed files with 32 additions and 22 deletions

View File

@ -37,6 +37,7 @@ type State struct {
//
// Next is //go:nosplit to allow its use in the runtime
// with per-m data without holding the per-m lock.
//
//go:nosplit
func (s *State) Next() (uint64, bool) {
i := s.i

View File

@ -38,6 +38,7 @@ func EqualFunc[M1 ~map[K]V1, M2 ~map[K]V2, K comparable, V1, V2 any](m1 M1, m2 M
}
// clone is implemented in the runtime package.
//
//go:linkname clone maps.clone
func clone(m any) any

View File

@ -14,6 +14,7 @@ import (
)
// provided by runtime
//
//go:linkname runtime_rand runtime.rand
func runtime_rand() uint64

View File

@ -115,6 +115,7 @@ func bootstrapRandReseed() {
}
// rand32 is uint32(rand()), called from compiler-generated code.
//
//go:nosplit
func rand32() uint32 {
return uint32(rand())
@ -122,6 +123,7 @@ func rand32() uint32 {
// rand returns a random uint64 from the per-m chacha8 state.
// Do not change signature: used via linkname from other packages.
//
//go:nosplit
//go:linkname rand
func rand() uint64 {
@ -159,6 +161,7 @@ func mrandinit(mp *m) {
// randn is like rand() % n but faster.
// Do not change signature: used via linkname from other packages.
//
//go:nosplit
//go:linkname randn
func randn(n uint32) uint32 {
@ -174,6 +177,7 @@ func randn(n uint32) uint32 {
// cheaprand must not be exported to other packages:
// the rule is that other packages using runtime-provided
// randomness must always use rand.
//
//go:nosplit
func cheaprand() uint32 {
mp := getg().m
@ -208,6 +212,7 @@ func cheaprand() uint32 {
// cheaprand64 must not be exported to other packages:
// the rule is that other packages using runtime-provided
// randomness must always use rand.
//
//go:nosplit
func cheaprand64() int64 {
return int64(cheaprand())<<31 ^ int64(cheaprand())
@ -218,6 +223,7 @@ func cheaprand64() int64 {
// cheaprandn must not be exported to other packages:
// the rule is that other packages using runtime-provided
// randomness must always use randn.
//
//go:nosplit
func cheaprandn(n uint32) uint32 {
// See https://lemire.me/blog/2016/06/27/a-fast-alternative-to-the-modulo-reduction/

View File

@ -76,6 +76,7 @@ type poolLocal struct {
}
// from runtime
//
//go:linkname runtime_randn runtime.randn
func runtime_randn(n uint32) uint32