From 07458099e9b2b7457a29ca2e1e175f82b76ccb59 Mon Sep 17 00:00:00 2001 From: Hau Nguyen Date: Mon, 28 Nov 2022 01:11:04 +0700 Subject: [PATCH] chore: format this project using this project :) --- Makefile | 4 +++- README.md | 15 +++++++++++++++ internal/cli/action.go | 3 ++- internal/cli/app.go | 3 ++- 4 files changed, 22 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 9500ee0..c92d307 100644 --- a/Makefile +++ b/Makefile @@ -23,8 +23,10 @@ lint: golangci-lint run ./... format: + go install github.com/haunt98/gofimports/cmd/gofimports@latest go install mvdan.cc/gofumpt@latest - gofumpt -l -w -extra . + gofimports -w -company github.com/make-go-great . + gofumpt -w -extra . build: go build ./cmd/gofimports diff --git a/README.md b/README.md index 1c993d2..ebd7319 100644 --- a/README.md +++ b/README.md @@ -28,6 +28,21 @@ go install github.com/haunt98/gofimports/cmd/gofimports@latest gofimports -l -company github.com/make-go-great -w -d ./internal ``` +Example result: + +```go +import ( + "fmt" + + "github.com/urfave/cli/v2" + "github.com/pkg/diff" + + "github.com/make-go-great/color-go" + + "github.com/haunt98/gofimports/internal/imports" +) +``` + ## Roadmap - [ ] Diff with color diff --git a/internal/cli/action.go b/internal/cli/action.go index 9025eec..1c30cf4 100644 --- a/internal/cli/action.go +++ b/internal/cli/action.go @@ -3,8 +3,9 @@ package cli import ( "fmt" - "github.com/haunt98/gofimports/internal/imports" "github.com/urfave/cli/v2" + + "github.com/haunt98/gofimports/internal/imports" ) type action struct { diff --git a/internal/cli/app.go b/internal/cli/app.go index 703211d..3490444 100644 --- a/internal/cli/app.go +++ b/internal/cli/app.go @@ -3,8 +3,9 @@ package cli import ( "os" - "github.com/make-go-great/color-go" "github.com/urfave/cli/v2" + + "github.com/make-go-great/color-go" ) const (