Skip to content

Commit

Permalink
all: run gofmt -w .
Browse files Browse the repository at this point in the history
  • Loading branch information
twpayne committed Jan 18, 2023
1 parent d74a05c commit dd94cda
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 32 deletions.
1 change: 0 additions & 1 deletion cmd/txtar-c/savedir.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
//
// See https://godoc.org/github.com/rogpeppe/go-internal/txtar for details of the format
// and how to parse a txtar file.
//
package main

import (
Expand Down
6 changes: 3 additions & 3 deletions cmd/txtar-goproxy/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
// This allows interactive experimentation with the set of proxied modules.
// For example:
//
// cd cmd/go
// go test -proxy=localhost:1234 &
// export GOPROXY=http://localhost:1234/mod
// cd cmd/go
// go test -proxy=localhost:1234 &
// export GOPROXY=http://localhost:1234/mod
//
// and then run go commands as usual.
package main
Expand Down
1 change: 0 additions & 1 deletion cmd/txtar-x/extract.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
//
// See https://godoc.org/github.com/rogpeppe/go-internal/txtar for details of the format
// and how to parse a txtar file.
//
package main

import (
Expand Down
25 changes: 12 additions & 13 deletions fmtsort/sort.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,19 +36,18 @@ func (o *SortedMap) Swap(i, j int) {
//
// The ordering rules are more general than with Go's < operator:
//
// - when applicable, nil compares low
// - ints, floats, and strings order by <
// - NaN compares less than non-NaN floats
// - bool compares false before true
// - complex compares real, then imag
// - pointers compare by machine address
// - channel values compare by machine address
// - structs compare each field in turn
// - arrays compare each element in turn.
// Otherwise identical arrays compare by length.
// - interface values compare first by reflect.Type describing the concrete type
// and then by concrete value as described in the previous rules.
//
// - when applicable, nil compares low
// - ints, floats, and strings order by <
// - NaN compares less than non-NaN floats
// - bool compares false before true
// - complex compares real, then imag
// - pointers compare by machine address
// - channel values compare by machine address
// - structs compare each field in turn
// - arrays compare each element in turn.
// Otherwise identical arrays compare by length.
// - interface values compare first by reflect.Type describing the concrete type
// and then by concrete value as described in the previous rules.
func Sort(mapValue reflect.Value) *SortedMap {
if mapValue.Type().Kind() != reflect.Map {
return nil
Expand Down
14 changes: 6 additions & 8 deletions imports/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ var slashslash = []byte("//")
// the purpose of satisfying build tags, in order to estimate
// (conservatively) whether a file could ever possibly be used
// in any build.
//
func ShouldBuild(content []byte, tags map[string]bool) bool {
// Pass 1. Identify leading run of // comments and blank lines,
// which must be followed by a blank line.
Expand Down Expand Up @@ -96,7 +95,6 @@ func ShouldBuild(content []byte, tags map[string]bool) bool {
// tag (if tags[tag] is true)
// !tag (if tags[tag] is false)
// a comma-separated list of any of these
//
func matchTags(name string, tags map[string]bool) bool {
if name == "" {
return false
Expand Down Expand Up @@ -145,12 +143,12 @@ func matchTag(name string, tags map[string]bool, want bool) bool {
// suffix which does not match the current system.
// The recognized name formats are:
//
// name_$(GOOS).*
// name_$(GOARCH).*
// name_$(GOOS)_$(GOARCH).*
// name_$(GOOS)_test.*
// name_$(GOARCH)_test.*
// name_$(GOOS)_$(GOARCH)_test.*
// name_$(GOOS).*
// name_$(GOARCH).*
// name_$(GOOS)_$(GOARCH).*
// name_$(GOOS)_test.*
// name_$(GOARCH)_test.*
// name_$(GOOS)_$(GOARCH)_test.*
//
// An exception: if GOOS=android, then files with GOOS=linux are also matched.
//
Expand Down
1 change: 0 additions & 1 deletion internal/syscall/windows/registry/key.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
//
// NOTE: This package is a copy of golang.org/x/sys/windows/registry
// with KeyInfo.ModTime removed to prevent dependency cycles.
//
package registry

import (
Expand Down
1 change: 0 additions & 1 deletion modfile/read.go
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,6 @@ func (x *Line) Span() (start, end Position) {
// "x"
// "y"
// )
//
type LineBlock struct {
Comments
Start Position
Expand Down
8 changes: 4 additions & 4 deletions testenv/testenv.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func Builder() string {
return os.Getenv("GO_BUILDER_NAME")
}

// HasGoBuild reports whether the current system can build programs with ``go build''
// HasGoBuild reports whether the current system can build programs with go build
// and then run them with os.StartProcess or exec.Command.
func HasGoBuild() bool {
if os.Getenv("GO_GCFLAGS") != "" {
Expand All @@ -51,7 +51,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 All @@ -63,13 +63,13 @@ func MustHaveGoBuild(t testing.TB) {
}
}

// HasGoRun reports whether the current system can run programs with ``go run.''
// HasGoRun reports whether the current system can run programs with go run.
func HasGoRun() bool {
// For now, having go run and having go build are the same.
return HasGoBuild()
}

// MustHaveGoRun checks that the current system can run programs with ``go run.''
// MustHaveGoRun checks that the current system can run programs with go run.
// If not, MustHaveGoRun calls t.Skip with an explanation.
func MustHaveGoRun(t testing.TB) {
if !HasGoRun() {
Expand Down

0 comments on commit dd94cda

Please sign in to comment.