aboutsummaryrefslogtreecommitdiff
path: root/src/runtime
diff options
context:
space:
mode:
authorMichael Pratt <mpratt@google.com>2025-11-20 16:25:40 -0500
committerGopher Robot <gobot@golang.org>2025-11-21 11:07:05 -0800
commite7787b9eca6bf0711cec1ac46841a8b09668f6a8 (patch)
treecb6ce6abc23b6efe17c6b8145e27359bc5ee26b2 /src/runtime
parent17b3b98796102d806f1d6fc3605b97741903ca1c (diff)
downloadgo-e7787b9eca6bf0711cec1ac46841a8b09668f6a8.tar.xz
runtime: go fmt
Change-Id: I6a6a636cf38ddb1dc6f2170361eb4093b81acdfb Reviewed-on: https://go-review.googlesource.com/c/go/+/722521 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Auto-Submit: Michael Pratt <mpratt@google.com> Reviewed-by: Michael Knyszek <mknyszek@google.com>
Diffstat (limited to 'src/runtime')
-rw-r--r--src/runtime/cgocall.go1
-rw-r--r--src/runtime/list.go8
-rw-r--r--src/runtime/list_manual.go8
-rw-r--r--src/runtime/mgcmark_nogreenteagc.go2
-rw-r--r--src/runtime/proc_test.go10
-rw-r--r--src/runtime/runtime2.go14
6 files changed, 22 insertions, 21 deletions
diff --git a/src/runtime/cgocall.go b/src/runtime/cgocall.go
index a53fd6da34..f01353ffa6 100644
--- a/src/runtime/cgocall.go
+++ b/src/runtime/cgocall.go
@@ -592,6 +592,7 @@ func cgoCheckPointer(ptr any, arg any) {
}
type cgoErrorMsg int
+
const (
cgoCheckPointerFail cgoErrorMsg = iota
cgoResultFail
diff --git a/src/runtime/list.go b/src/runtime/list.go
index c900ad7ff3..43b51996e4 100644
--- a/src/runtime/list.go
+++ b/src/runtime/list.go
@@ -34,11 +34,11 @@ func (head *listHead) init(off uintptr) {
//
// For example:
//
-// type foo struct {
-// val int
+// type foo struct {
+// val int
//
-// node listNode
-// }
+// node listNode
+// }
//
// var fooHead listHead
// fooHead.init(unsafe.Offsetof(foo{}.node))
diff --git a/src/runtime/list_manual.go b/src/runtime/list_manual.go
index af0ae6b2d6..f0ce9ad4da 100644
--- a/src/runtime/list_manual.go
+++ b/src/runtime/list_manual.go
@@ -41,11 +41,11 @@ func (head *listHeadManual) init(off uintptr) {
//
// For example:
//
-// type foo struct {
-// val int
+// type foo struct {
+// val int
//
-// node listNodeManual
-// }
+// node listNodeManual
+// }
//
// var fooHead listHeadManual
// fooHead.init(unsafe.Offsetof(foo{}.node))
diff --git a/src/runtime/mgcmark_nogreenteagc.go b/src/runtime/mgcmark_nogreenteagc.go
index a0470c6e32..ce0d8d80f3 100644
--- a/src/runtime/mgcmark_nogreenteagc.go
+++ b/src/runtime/mgcmark_nogreenteagc.go
@@ -67,7 +67,7 @@ func (q *spanQueue) destroy() {
}
type spanSPMC struct {
- _ sys.NotInHeap
+ _ sys.NotInHeap
allnode listNodeManual
}
diff --git a/src/runtime/proc_test.go b/src/runtime/proc_test.go
index cff8775cc9..a2c8b55342 100644
--- a/src/runtime/proc_test.go
+++ b/src/runtime/proc_test.go
@@ -1175,9 +1175,9 @@ func TestBigGOMAXPROCS(t *testing.T) {
}
type goroutineState struct {
- G trace.GoID // This goroutine.
- P trace.ProcID // Most recent P this goroutine ran on.
- M trace.ThreadID // Most recent M this goroutine ran on.
+ G trace.GoID // This goroutine.
+ P trace.ProcID // Most recent P this goroutine ran on.
+ M trace.ThreadID // Most recent M this goroutine ran on.
}
func newGoroutineState(g trace.GoID) *goroutineState {
@@ -1228,7 +1228,7 @@ func TestTraceSTW(t *testing.T) {
}
}
- pct := float64(errors)/float64(runs)
+ pct := float64(errors) / float64(runs)
t.Logf("Errors: %d/%d = %f%%", errors, runs, 100*pct)
if pct > 0.25 {
t.Errorf("Error rate too high")
@@ -1264,7 +1264,7 @@ func TestTraceGCSTW(t *testing.T) {
}
}
- pct := float64(errors)/float64(runs)
+ pct := float64(errors) / float64(runs)
t.Logf("Errors: %d/%d = %f%%", errors, runs, 100*pct)
if pct > 0.25 {
t.Errorf("Error rate too high")
diff --git a/src/runtime/runtime2.go b/src/runtime/runtime2.go
index 56082bf7f5..3175ee55f5 100644
--- a/src/runtime/runtime2.go
+++ b/src/runtime/runtime2.go
@@ -838,7 +838,7 @@ type p struct {
palloc persistentAlloc // per-P to avoid mutex
// Per-P GC state
- gcAssistTime int64 // Nanoseconds in assistAlloc
+ gcAssistTime int64 // Nanoseconds in assistAlloc
gcFractionalMarkTime atomic.Int64 // Nanoseconds in fractional mark worker
// limiterEvent tracks events for the GC CPU limiter.
@@ -934,12 +934,12 @@ type schedt struct {
// sure to call checkdead().
midle listHeadManual // idle m's waiting for work
- nmidle int32 // number of idle m's waiting for work
- nmidlelocked int32 // number of locked m's waiting for work
- mnext int64 // number of m's that have been created and next M ID
- maxmcount int32 // maximum number of m's allowed (or die)
- nmsys int32 // number of system m's not counted for deadlock
- nmfreed int64 // cumulative number of freed m's
+ nmidle int32 // number of idle m's waiting for work
+ nmidlelocked int32 // number of locked m's waiting for work
+ mnext int64 // number of m's that have been created and next M ID
+ maxmcount int32 // maximum number of m's allowed (or die)
+ nmsys int32 // number of system m's not counted for deadlock
+ nmfreed int64 // cumulative number of freed m's
ngsys atomic.Int32 // number of system goroutines
nGsyscallNoP atomic.Int32 // number of goroutines in syscalls without a P