Skip to content

Commit

Permalink
all: apply Go 1.18's gofmt -s
Browse files Browse the repository at this point in the history
This adds the missing go:build lines as per the transition away from the
"// +build" build tag syntax, and applies two "-s" simplifications.

Note that we avoid applying -s to cmd/cue/cmd/interfaces_gen.go,
as that file is generated and we're not updating the generator here.

Change-Id: I29ed06a4b102a5101baa12a455a0bb4c524c46ef
Signed-off-by: Daniel Martí <mvdan@mvdan.cc>
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/536095
Unity-Result: CUEcueckoo <cueckoo@cuelang.org>
TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>
Reviewed-by: Marcel van Lohuizen <mpvl@gmail.com>
  • Loading branch information
mvdan authored and mpvl committed Apr 13, 2022
1 parent 69e2dcc commit 5c43a87
Show file tree
Hide file tree
Showing 16 changed files with 16 additions and 3 deletions.
1 change: 1 addition & 0 deletions cue/parser/fuzz.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

//go:build gofuzz
// +build gofuzz

package parser
Expand Down
1 change: 1 addition & 0 deletions cue/scanner/fuzz.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

//go:build gofuzz
// +build gofuzz

package scanner
Expand Down
1 change: 1 addition & 0 deletions encoding/gocode/gen_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

//go:build !gen
// +build !gen

package gocode
Expand Down
1 change: 1 addition & 0 deletions internal/cuetest/long.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

//go:build long
// +build long

package cuetest
Expand Down
1 change: 1 addition & 0 deletions internal/cuetest/nolong.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

//go:build !long
// +build !long

package cuetest
Expand Down
2 changes: 1 addition & 1 deletion internal/encoding/json/encode_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ f4: {
func TestEncodeAST(t *testing.T) {
comment := func(s string) *ast.CommentGroup {
return &ast.CommentGroup{List: []*ast.Comment{
&ast.Comment{Text: "// " + s},
{Text: "// " + s},
}}
}
testCases := []struct {
Expand Down
2 changes: 1 addition & 1 deletion internal/encoding/yaml/encode_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ route:
func TestEncodeAST(t *testing.T) {
comment := func(s string) *ast.CommentGroup {
return &ast.CommentGroup{List: []*ast.Comment{
&ast.Comment{Text: "// " + s},
{Text: "// " + s},
}}
}
testCases := []struct {
Expand Down
1 change: 1 addition & 0 deletions internal/filetypes/gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

//go:build ignore
// +build ignore

package main
Expand Down
1 change: 1 addition & 0 deletions pkg/tool/cli/gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

//go:build ignore
// +build ignore

package main
Expand Down
1 change: 1 addition & 0 deletions pkg/tool/exec/gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

//go:build ignore
// +build ignore

package main
Expand Down
1 change: 1 addition & 0 deletions pkg/tool/file/gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

//go:build ignore
// +build ignore

package main
Expand Down
1 change: 1 addition & 0 deletions pkg/tool/gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

//go:build ignore
// +build ignore

package main
Expand Down
1 change: 1 addition & 0 deletions pkg/tool/http/gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

//go:build ignore
// +build ignore

package main
Expand Down
1 change: 1 addition & 0 deletions pkg/tool/os/gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

//go:build ignore
// +build ignore

package main
Expand Down
1 change: 1 addition & 0 deletions tools.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

//go:build tools
// +build tools

package tools
Expand Down
2 changes: 1 addition & 1 deletion tools/flow/flow_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ func taskFunc(v cue.Value) (flow.Runner, error) {

case "list":
return flow.RunnerFunc(func(t *flow.Task) error {
t.Fill(map[string][]int{"out": []int{1, 2}})
t.Fill(map[string][]int{"out": {1, 2}})
return nil
}), nil

Expand Down

0 comments on commit 5c43a87

Please sign in to comment.