diff options
author | Brad Fitzpatrick <bradfitz@golang.org> | 2016-03-01 23:21:55 +0000 |
---|---|---|
committer | Brad Fitzpatrick <bradfitz@golang.org> | 2016-03-02 00:13:47 +0000 |
commit | 5fea2ccc77eb50a9704fa04b7c61755fe34e1d95 (patch) | |
tree | 00137f90183ae2a01ca42249e04e9e4dabdf6249 /src/cmd/gofmt | |
parent | 8b4deb448e587802f67930b765c9598fc8cd36e5 (diff) | |
download | go-5fea2ccc77eb50a9704fa04b7c61755fe34e1d95.tar.gz go-5fea2ccc77eb50a9704fa04b7c61755fe34e1d95.zip |
all: single space after period.
The tree's pretty inconsistent about single space vs double space
after a period in documentation. Make it consistently a single space,
per earlier decisions. This means contributors won't be confused by
misleading precedence.
This CL doesn't use go/doc to parse. It only addresses // comments.
It was generated with:
$ perl -i -npe 's,^(\s*// .+[a-z]\.) +([A-Z]),$1 $2,' $(git grep -l -E '^\s*//(.+\.) +([A-Z])')
$ go test go/doc -update
Change-Id: Iccdb99c37c797ef1f804a94b22ba5ee4b500c4f7
Reviewed-on: https://go-review.googlesource.com/20022
Reviewed-by: Rob Pike <r@golang.org>
Reviewed-by: Dave Day <djd@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Diffstat (limited to 'src/cmd/gofmt')
-rw-r--r-- | src/cmd/gofmt/internal.go | 6 | ||||
-rw-r--r-- | src/cmd/gofmt/rewrite.go | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/cmd/gofmt/internal.go b/src/cmd/gofmt/internal.go index f764b10ebb..cbc6983b61 100644 --- a/src/cmd/gofmt/internal.go +++ b/src/cmd/gofmt/internal.go @@ -28,9 +28,9 @@ func parse(fset *token.FileSet, filename string, src []byte, fragmentOk bool) ( ) { // Try as whole source file. file, err = parser.ParseFile(fset, filename, src, parserMode) - // If there's no error, return. If the error is that the source file didn't begin with a + // If there's no error, return. If the error is that the source file didn't begin with a // package line and source fragments are ok, fall through to - // try as a source fragment. Stop and return on any other error. + // try as a source fragment. Stop and return on any other error. if err == nil || !fragmentOk || !strings.Contains(err.Error(), "expected 'package'") { return } @@ -59,7 +59,7 @@ func parse(fset *token.FileSet, filename string, src []byte, fragmentOk bool) ( // If this is a statement list, make it a source file // by inserting a package clause and turning the list - // into a function body. This handles expressions too. + // into a function body. This handles expressions too. // Insert using a ;, not a newline, so that the line numbers // in fsrc match the ones in src. Add an extra '\n' before the '}' // to make sure comments are flushed before the '}'. diff --git a/src/cmd/gofmt/rewrite.go b/src/cmd/gofmt/rewrite.go index 1eaeca6f10..550492bf29 100644 --- a/src/cmd/gofmt/rewrite.go +++ b/src/cmd/gofmt/rewrite.go @@ -158,7 +158,7 @@ func isWildcard(s string) bool { // recording wildcard submatches in m. // If m == nil, match checks whether pattern == val. func match(m map[string]reflect.Value, pattern, val reflect.Value) bool { - // Wildcard matches any expression. If it appears multiple + // Wildcard matches any expression. If it appears multiple // times in the pattern, it must match the same expression // each time. if m != nil && pattern.IsValid() && pattern.Type() == identType { |