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: Ic98f647623f234cf5d36309c6204683e151820d7
Reviewed-on: https://go-review.googlesource.com/c/example/+/399596
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Russ Cox <rsc@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
  • Loading branch information
HadesHappy committed Apr 12, 2022
1 parent 3e2dd57 commit a77fb05
Show file tree
Hide file tree
Showing 10 changed files with 15 additions and 12 deletions.
2 changes: 1 addition & 1 deletion gotypes/defsuses/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ func main() {
}
`

//!+
// !+
func PrintDefsUses(fset *token.FileSet, files ...*ast.File) error {
conf := types.Config{Importer: importer.Default()}
info := &types.Info{
Expand Down
2 changes: 1 addition & 1 deletion gotypes/hello/hello.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//!+
// !+
package main

import "fmt"
Expand Down
3 changes: 2 additions & 1 deletion gotypes/hugeparam/main.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// The hugeparam command identifies by-value parameters that are larger than n bytes.
//
// Example:
//
// $ ./hugeparams encoding/xml
package main

Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion gotypes/implements/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"log"
)

//!+input
// !+input
const input = `package main
type A struct{}
Expand Down
4 changes: 2 additions & 2 deletions gotypes/lookup/lookup.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"strings"
)

//!+input
// !+input
const hello = `
package main
Expand All @@ -32,7 +32,7 @@ func main() {

//!-input

//!+main
// !+main
func main() {
fset := token.NewFileSet()
f, err := parser.ParseFile(fset, "hello.go", hello, parser.ParseComments)
Expand Down
4 changes: 2 additions & 2 deletions gotypes/nilfunc/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"log"
)

//!+input
// !+input
const input = `package main
import "bytes"
Expand Down Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion gotypes/pkginfo/main.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//!+
// !+
package main

import (
Expand Down
3 changes: 2 additions & 1 deletion gotypes/skeleton/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// that implements the specified interface type.
//
// Example:
//
// $ ./skeleton io ReadWriteCloser buffer
// // *buffer implements io.ReadWriteCloser.
// type buffer struct{ /* ... */ }
Expand All @@ -24,7 +25,7 @@ import (

const usage = "Usage: skeleton <package> <interface> <concrete>"

//!+
// !+
func PrintSkeleton(pkg *types.Package, ifacename, concname string) error {
obj := pkg.Scope().Lookup(ifacename)
if obj == nil {
Expand Down
2 changes: 1 addition & 1 deletion gotypes/typeandvalue/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"log"
)

//!+input
// !+input
const input = `
package main
Expand Down
3 changes: 2 additions & 1 deletion gotypes/weave.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down

0 comments on commit a77fb05

Please sign in to comment.