Skip to content

Commit

Permalink
Use goimports as formatting standard
Browse files Browse the repository at this point in the history
given some disagreement with gofmt that seems to have shown up in 1.19
  • Loading branch information
meatballhat committed Aug 14, 2022
1 parent 27b4569 commit ade5edb
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 16 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,16 @@ jobs:
- name: Set PATH
run: echo "${GITHUB_WORKSPACE}/.local/bin" >>"${GITHUB_PATH}"

- name: install goimports
if: matrix.go == '1.19.x' && matrix.os == 'ubuntu-latest'
run: GOBIN=${PWD}/.local/bin go install golang.org/x/tools/cmd/goimports@latest

- name: Checkout Code
uses: actions/checkout@v3

- name: GOFMT Check
- name: goimports check
if: matrix.go == '1.19.x' && matrix.os == 'ubuntu-latest'
run: test -z $(gofmt -l .)
run: test -z $(goimports -l .)

- name: vet
run: go run internal/build/build.go vet
Expand Down
30 changes: 16 additions & 14 deletions cli.go
Original file line number Diff line number Diff line change
@@ -1,23 +1,25 @@
// Package cli provides a minimal framework for creating and organizing command line
// Go applications. cli is designed to be easy to understand and write, the most simple
// cli application can be written as follows:
// func main() {
// (&cli.App{}).Run(os.Args)
// }
//
// func main() {
// (&cli.App{}).Run(os.Args)
// }
//
// Of course this application does not do much, so let's make this an actual application:
// func main() {
// app := &cli.App{
// Name: "greet",
// Usage: "say a greeting",
// Action: func(c *cli.Context) error {
// fmt.Println("Greetings")
// return nil
// },
// }
//
// app.Run(os.Args)
// }
// func main() {
// app := &cli.App{
// Name: "greet",
// Usage: "say a greeting",
// Action: func(c *cli.Context) error {
// fmt.Println("Greetings")
// return nil
// },
// }
//
// app.Run(os.Args)
// }
package cli

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

0 comments on commit ade5edb

Please sign in to comment.