From a71bb570d064f6d0c1cf59cef4b7a044be7a39d3 Mon Sep 17 00:00:00 2001 From: cuishuang Date: Thu, 4 Jul 2024 14:10:55 +0800 Subject: [PATCH] all: make struct comments match struct names Change-Id: I011f66854a9af5f3baa20abebd4b315c15db571f Reviewed-on: https://go-review.googlesource.com/c/go/+/596715 Reviewed-by: Dmitri Shuralyov Reviewed-by: Dmitri Shuralyov TryBot-Result: Gopher Robot Run-TryBot: shuang cui Auto-Submit: Dmitri Shuralyov Reviewed-by: Ian Lance Taylor Auto-Submit: Ian Lance Taylor Commit-Queue: Ian Lance Taylor LUCI-TryBot-Result: Go LUCI --- src/cmd/trace/gstate.go | 2 +- src/internal/coverage/defs.go | 2 +- src/log/slog/internal/buffer/buffer.go | 5 ++++- src/runtime/arena.go | 2 +- src/sync/export_test.go | 2 +- 5 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/cmd/trace/gstate.go b/src/cmd/trace/gstate.go index bcbe3b6c7f..638d492670 100644 --- a/src/cmd/trace/gstate.go +++ b/src/cmd/trace/gstate.go @@ -46,7 +46,7 @@ type gState[R resource] struct { // goroutine stopped executing. These are flushed on every stop or block. completedRanges []completedRange - // startRunning is the most recent event that caused a goroutine to + // startRunningTime is the most recent event that caused a goroutine to // transition to GoRunning. startRunningTime trace.Time diff --git a/src/internal/coverage/defs.go b/src/internal/coverage/defs.go index 340ac95635..1ef47638e6 100644 --- a/src/internal/coverage/defs.go +++ b/src/internal/coverage/defs.go @@ -267,7 +267,7 @@ func (cm CounterGranularity) String() string { // by the Go command and by the coverage runtime. const MetaFilesFileName = "metafiles.txt" -// MetaFilePaths contains information generated by the Go command and +// MetaFileCollection contains information generated by the Go command and // the read in by coverage test support functions within an executing // "go test -cover" binary. type MetaFileCollection struct { diff --git a/src/log/slog/internal/buffer/buffer.go b/src/log/slog/internal/buffer/buffer.go index 310ec37d4a..110c6281ab 100644 --- a/src/log/slog/internal/buffer/buffer.go +++ b/src/log/slog/internal/buffer/buffer.go @@ -7,7 +7,10 @@ package buffer import "sync" -// buffer adapted from go/src/fmt/print.go +// Buffer is a byte buffer. +// +// This implementation is adapted from the unexported type buffer +// in go/src/fmt/print.go. type Buffer []byte // Having an initial size gives a dramatic speedup. diff --git a/src/runtime/arena.go b/src/runtime/arena.go index 47b131466c..cd9a9dfae1 100644 --- a/src/runtime/arena.go +++ b/src/runtime/arena.go @@ -232,7 +232,7 @@ func userArenaChunkReserveBytes() uintptr { } type userArena struct { - // full is a list of full chunks that have not enough free memory left, and + // fullList is a list of full chunks that have not enough free memory left, and // that we'll free once this user arena is freed. // // Can't use mSpanList here because it's not-in-heap. diff --git a/src/sync/export_test.go b/src/sync/export_test.go index b55cecd987..ddde30e018 100644 --- a/src/sync/export_test.go +++ b/src/sync/export_test.go @@ -10,7 +10,7 @@ var Runtime_Semrelease = runtime_Semrelease var Runtime_procPin = runtime_procPin var Runtime_procUnpin = runtime_procUnpin -// poolDequeue testing. +// PoolDequeue exports an interface for pollDequeue testing. type PoolDequeue interface { PushHead(val any) bool PopHead() (any, bool)