Skip to content

Commit ade5edb

Browse files
committed
Use goimports as formatting standard
given some disagreement with gofmt that seems to have shown up in 1.19
1 parent 27b4569 commit ade5edb

File tree

2 files changed

+22
-16
lines changed

2 files changed

+22
-16
lines changed

.github/workflows/cli.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,16 @@ jobs:
2727
- name: Set PATH
2828
run: echo "${GITHUB_WORKSPACE}/.local/bin" >>"${GITHUB_PATH}"
2929

30+
- name: install goimports
31+
if: matrix.go == '1.19.x' && matrix.os == 'ubuntu-latest'
32+
run: GOBIN=${PWD}/.local/bin go install golang.org/x/tools/cmd/goimports@latest
33+
3034
- name: Checkout Code
3135
uses: actions/checkout@v3
3236

33-
- name: GOFMT Check
37+
- name: goimports check
3438
if: matrix.go == '1.19.x' && matrix.os == 'ubuntu-latest'
35-
run: test -z $(gofmt -l .)
39+
run: test -z $(goimports -l .)
3640

3741
- name: vet
3842
run: go run internal/build/build.go vet

cli.go

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,25 @@
11
// Package cli provides a minimal framework for creating and organizing command line
22
// Go applications. cli is designed to be easy to understand and write, the most simple
33
// cli application can be written as follows:
4-
// func main() {
5-
// (&cli.App{}).Run(os.Args)
6-
// }
4+
//
5+
// func main() {
6+
// (&cli.App{}).Run(os.Args)
7+
// }
78
//
89
// Of course this application does not do much, so let's make this an actual application:
9-
// func main() {
10-
// app := &cli.App{
11-
// Name: "greet",
12-
// Usage: "say a greeting",
13-
// Action: func(c *cli.Context) error {
14-
// fmt.Println("Greetings")
15-
// return nil
16-
// },
17-
// }
1810
//
19-
// app.Run(os.Args)
20-
// }
11+
// func main() {
12+
// app := &cli.App{
13+
// Name: "greet",
14+
// Usage: "say a greeting",
15+
// Action: func(c *cli.Context) error {
16+
// fmt.Println("Greetings")
17+
// return nil
18+
// },
19+
// }
20+
//
21+
// app.Run(os.Args)
22+
// }
2123
package cli
2224

2325
//go:generate go run internal/genflags/cmd/genflags/main.go

0 commit comments

Comments
 (0)