From cb55c9ffdcd1647d020e2f1e56a20338f71292a8 Mon Sep 17 00:00:00 2001 From: softdev050 Date: Mon, 11 Apr 2022 13:09:59 -0400 Subject: [PATCH] all: gofmt Gofmt to update doc comments to the new formatting. For golang/go#51082. Change-Id: Ic98f647623f234cf5d36309c6204683e151820d7 Reviewed-on: https://go-review.googlesource.com/c/example/+/399596 Run-TryBot: Russ Cox TryBot-Result: Gopher Robot Auto-Submit: Russ Cox Reviewed-by: Ian Lance Taylor --- gotypes/defsuses/main.go | 2 +- gotypes/hello/hello.go | 2 +- gotypes/hugeparam/main.go | 3 ++- gotypes/implements/main.go | 2 +- gotypes/lookup/lookup.go | 4 ++-- gotypes/nilfunc/main.go | 4 ++-- gotypes/pkginfo/main.go | 2 +- gotypes/skeleton/main.go | 3 ++- gotypes/typeandvalue/main.go | 2 +- gotypes/weave.go | 3 ++- 10 files changed, 15 insertions(+), 12 deletions(-) diff --git a/gotypes/defsuses/main.go b/gotypes/defsuses/main.go index 5347f48..bdddc6c 100644 --- a/gotypes/defsuses/main.go +++ b/gotypes/defsuses/main.go @@ -19,7 +19,7 @@ func main() { } ` -//!+ +// !+ func PrintDefsUses(fset *token.FileSet, files ...*ast.File) error { conf := types.Config{Importer: importer.Default()} info := &types.Info{ diff --git a/gotypes/hello/hello.go b/gotypes/hello/hello.go index 01a2862..431bcc1 100644 --- a/gotypes/hello/hello.go +++ b/gotypes/hello/hello.go @@ -1,4 +1,4 @@ -//!+ +// !+ package main import "fmt" diff --git a/gotypes/hugeparam/main.go b/gotypes/hugeparam/main.go index 1474403..80fc47e 100644 --- a/gotypes/hugeparam/main.go +++ b/gotypes/hugeparam/main.go @@ -1,6 +1,7 @@ // The hugeparam command identifies by-value parameters that are larger than n bytes. // // Example: +// // $ ./hugeparams encoding/xml package main @@ -15,7 +16,7 @@ import ( "golang.org/x/tools/go/loader" ) -//!+ +// !+ var bytesFlag = flag.Int("bytes", 48, "maximum parameter size in bytes") var sizeof = (&types.StdSizes{8, 8}).Sizeof // the sizeof function diff --git a/gotypes/implements/main.go b/gotypes/implements/main.go index 70b4ee5..5c1fc99 100644 --- a/gotypes/implements/main.go +++ b/gotypes/implements/main.go @@ -10,7 +10,7 @@ import ( "log" ) -//!+input +// !+input const input = `package main type A struct{} diff --git a/gotypes/lookup/lookup.go b/gotypes/lookup/lookup.go index 4313e2e..074eb72 100644 --- a/gotypes/lookup/lookup.go +++ b/gotypes/lookup/lookup.go @@ -11,7 +11,7 @@ import ( "strings" ) -//!+input +// !+input const hello = ` package main @@ -32,7 +32,7 @@ func main() { //!-input -//!+main +// !+main func main() { fset := token.NewFileSet() f, err := parser.ParseFile(fset, "hello.go", hello, parser.ParseComments) diff --git a/gotypes/nilfunc/main.go b/gotypes/nilfunc/main.go index 2dbb19c..1e976d9 100644 --- a/gotypes/nilfunc/main.go +++ b/gotypes/nilfunc/main.go @@ -10,7 +10,7 @@ import ( "log" ) -//!+input +// !+input const input = `package main import "bytes" @@ -50,7 +50,7 @@ func main() { }) } -//!+ +// !+ // CheckNilFuncComparison reports unintended comparisons // of functions against nil, e.g., "if x.Method == nil {". func CheckNilFuncComparison(info *types.Info, n ast.Node) { diff --git a/gotypes/pkginfo/main.go b/gotypes/pkginfo/main.go index 957e01b..15dbf10 100644 --- a/gotypes/pkginfo/main.go +++ b/gotypes/pkginfo/main.go @@ -1,4 +1,4 @@ -//!+ +// !+ package main import ( diff --git a/gotypes/skeleton/main.go b/gotypes/skeleton/main.go index c3961e2..1e6ee82 100644 --- a/gotypes/skeleton/main.go +++ b/gotypes/skeleton/main.go @@ -2,6 +2,7 @@ // that implements the specified interface type. // // Example: +// // $ ./skeleton io ReadWriteCloser buffer // // *buffer implements io.ReadWriteCloser. // type buffer struct{ /* ... */ } @@ -24,7 +25,7 @@ import ( const usage = "Usage: skeleton " -//!+ +// !+ func PrintSkeleton(pkg *types.Package, ifacename, concname string) error { obj := pkg.Scope().Lookup(ifacename) if obj == nil { diff --git a/gotypes/typeandvalue/main.go b/gotypes/typeandvalue/main.go index 7b3b553..c7fb8ed 100644 --- a/gotypes/typeandvalue/main.go +++ b/gotypes/typeandvalue/main.go @@ -12,7 +12,7 @@ import ( "log" ) -//!+input +// !+input const input = ` package main diff --git a/gotypes/weave.go b/gotypes/weave.go index cfaa57b..bf8264a 100644 --- a/gotypes/weave.go +++ b/gotypes/weave.go @@ -2,7 +2,8 @@ // It builds a table of contents and processes %include directives. // // Example usage: -// $ go run weave.go go-types.md > README.md +// +// $ go run weave.go go-types.md > README.md package main import (