Skip to content

Commit

Permalink
all: gofmt
Browse files Browse the repository at this point in the history
Gofmt to update doc comments to the new formatting.

For golang/go#51082.

Change-Id: Ic04931a8c8a48d2ca5921a1cf7b3969efcb93cc3
Reviewed-on: https://go-review.googlesource.com/c/debug/+/399594
Run-TryBot: Russ Cox <[email protected]>
TryBot-Result: Gopher Robot <[email protected]>
Reviewed-by: Ian Lance Taylor <[email protected]>
Auto-Submit: Russ Cox <[email protected]>
  • Loading branch information
rsc authored and gopherbot committed Apr 12, 2022
1 parent 0bd8c7d commit 405b155
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 20 deletions.
1 change: 0 additions & 1 deletion dwtest/testdata/dwdumploc.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ type opener interface {

// elfOpener implements the opener interface for ELF
// (https://en.wikipedia.org/wiki/Executable_and_Linkable_Format) binaries
//
type elfOpener struct {
}

Expand Down
10 changes: 6 additions & 4 deletions internal/core/core_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,12 @@ import (

// loadExample loads a simple core file which resulted from running the
// following program on linux/amd64 with go 1.9.0 (the earliest supported runtime):
// package main
// func main() {
// _ = *(*int)(nil)
// }
//
// package main
//
// func main() {
// _ = *(*int)(nil)
// }
func loadExample(t *testing.T, useExePath bool) *Process {
t.Helper()
var p *Process
Expand Down
7 changes: 4 additions & 3 deletions internal/gocore/dwarf.go
Original file line number Diff line number Diff line change
Expand Up @@ -252,9 +252,10 @@ func dwarfSize(dt dwarf.Type, ptrSize int64) int64 {
// gocoreName generates the name this package uses to refer to a dwarf type.
// This name differs from the dwarf name in that it stays closer to the Go name for the type.
// For instance (dwarf name -> gocoreName)
// struct runtime.siginfo -> runtime.siginfo
// *void -> unsafe.Pointer
// struct struct { runtime.signalLock uint32; runtime.hz int32 } -> struct { signalLock uint32; hz int32 }
//
// struct runtime.siginfo -> runtime.siginfo
// *void -> unsafe.Pointer
// struct struct { runtime.signalLock uint32; runtime.hz int32 } -> struct { signalLock uint32; hz int32 }
func gocoreName(dt dwarf.Type) string {
switch x := dt.(type) {
case *dwarf.PtrType:
Expand Down
10 changes: 6 additions & 4 deletions internal/gocore/gocore_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,12 @@ import (

// loadTest loads a simple core file which resulted from running the
// following program on linux/amd64 with go 1.9.0 (the earliest supported runtime):
// package main
// func main() {
// _ = *(*int)(nil)
// }
//
// package main
//
// func main() {
// _ = *(*int)(nil)
// }
func loadExample(t *testing.T) *Process {
t.Helper()
if runtime.GOOS == "android" {
Expand Down
8 changes: 5 additions & 3 deletions internal/gocore/object.go
Original file line number Diff line number Diff line change
Expand Up @@ -247,9 +247,11 @@ func (p *Process) Type(x Object) (*Type, int64) {

// ForEachPtr calls fn for all heap pointers it finds in x.
// It calls fn with:
// the offset of the pointer slot in x
// the pointed-to object y
// the offset in y where the pointer points.
//
// the offset of the pointer slot in x
// the pointed-to object y
// the offset in y where the pointer points.
//
// If fn returns false, ForEachPtr returns immediately.
// For an edge from an object to its finalizer, the first argument
// passed to fn will be -1. (TODO: implement)
Expand Down
8 changes: 5 additions & 3 deletions internal/gocore/reverse.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,11 @@ func (p *Process) reverseEdges() {

// ForEachReversePtr calls fn for all pointers it finds pointing to y.
// It calls fn with:
// the object or root which points to y (exactly one will be non-nil)
// the offset i in that object or root where the pointer appears.
// the offset j in y where the pointer points.
//
// the object or root which points to y (exactly one will be non-nil)
// the offset i in that object or root where the pointer appears.
// the offset j in y where the pointer points.
//
// If fn returns false, ForEachReversePtr returns immediately.
func (p *Process) ForEachReversePtr(y Object, fn func(x Object, r *Root, i, j int64) bool) {
p.reverseEdges()
Expand Down
4 changes: 2 additions & 2 deletions internal/testenv/testenv.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (
)

// HasGoBuild reports whether the current system can build programs
// with ``go build'' and then run them with os.StartProcess or
// with go build and then run them with os.StartProcess or
// exec.Command.
func HasGoBuild() bool {
if os.Getenv("GO_GCFLAGS") != "" {
Expand All @@ -36,7 +36,7 @@ func HasGoBuild() bool {
return true
}

// MustHaveGoBuild checks that the current system can build programs with ``go build''
// MustHaveGoBuild checks that the current system can build programs with go build
// and then run them with os.StartProcess or exec.Command.
// If not, MustHaveGoBuild calls t.Skip with an explanation.
func MustHaveGoBuild(t testing.TB) {
Expand Down

0 comments on commit 405b155

Please sign in to comment.