Update goimports

This commit is contained in:
c-bata 2018-12-09 20:09:33 +09:00
parent f4022536e6
commit e0253e45f3
14 changed files with 17 additions and 15 deletions

@ -1,5 +1,7 @@
.DEFAULT_GOAL := help .DEFAULT_GOAL := help
SOURCES := $(shell find . -path ./vendor -prune -o -name "*.go" -not -name '*_test.go' -print)
.PHONY: setup .PHONY: setup
setup: ## Setup for required tools. setup: ## Setup for required tools.
go get -u golang.org/x/lint/golint go get -u golang.org/x/lint/golint
@ -9,8 +11,8 @@ setup: ## Setup for required tools.
dep ensure dep ensure
.PHONY: fmt .PHONY: fmt
fmt: ## Formatting source codes. fmt: $(SOURCES) ## Formatting source codes.
@goimports -w $(find . -type f -name '*.go' -not -path "./vendor/*") @goimports -w $^
.PHONY: lint .PHONY: lint
lint: ## Run golint and go vet. lint: ## Run golint and go vet.

@ -4,7 +4,7 @@ import (
"os" "os"
"os/exec" "os/exec"
"github.com/c-bata/go-prompt" prompt "github.com/c-bata/go-prompt"
) )
func executor(t string) { func executor(t string) {

@ -10,7 +10,7 @@ import (
"path" "path"
"strings" "strings"
"github.com/c-bata/go-prompt" prompt "github.com/c-bata/go-prompt"
) )
type RequestContext struct { type RequestContext struct {

@ -3,7 +3,7 @@ package main
import ( import (
"fmt" "fmt"
"github.com/c-bata/go-prompt" prompt "github.com/c-bata/go-prompt"
) )
var LivePrefixState struct { var LivePrefixState struct {

@ -3,7 +3,7 @@ package main
import ( import (
"fmt" "fmt"
"github.com/c-bata/go-prompt" prompt "github.com/c-bata/go-prompt"
) )
func executor(in string) { func executor(in string) {

@ -3,7 +3,7 @@ package main
import ( import (
"fmt" "fmt"
"github.com/c-bata/go-prompt" prompt "github.com/c-bata/go-prompt"
) )
func completer(in prompt.Document) []prompt.Suggest { func completer(in prompt.Document) []prompt.Suggest {

@ -5,7 +5,7 @@ import (
"os" "os"
"strings" "strings"
"github.com/c-bata/go-prompt" prompt "github.com/c-bata/go-prompt"
"github.com/c-bata/go-prompt/completer" "github.com/c-bata/go-prompt/completer"
) )

@ -4,7 +4,7 @@ import (
"fmt" "fmt"
"syscall" "syscall"
"github.com/c-bata/go-prompt" prompt "github.com/c-bata/go-prompt"
"github.com/pkg/term/termios" "github.com/pkg/term/termios"
) )

@ -8,7 +8,7 @@ import (
"path/filepath" "path/filepath"
"runtime" "runtime"
"github.com/c-bata/go-prompt" prompt "github.com/c-bata/go-prompt"
) )
var ( var (

@ -4,7 +4,7 @@ import (
"log" "log"
"strings" "strings"
"github.com/mattn/go-runewidth" runewidth "github.com/mattn/go-runewidth"
) )
const ( const (

@ -5,7 +5,7 @@ import (
"strings" "strings"
"unicode/utf8" "unicode/utf8"
"github.com/mattn/go-runewidth" runewidth "github.com/mattn/go-runewidth"
) )
// Document has text displayed in terminal and cursor position. // Document has text displayed in terminal and cursor position.

@ -9,7 +9,7 @@ import (
"unicode/utf8" "unicode/utf8"
"unsafe" "unsafe"
"github.com/mattn/go-tty" tty "github.com/mattn/go-tty"
) )
const maxReadBytes = 1024 const maxReadBytes = 1024

@ -5,7 +5,7 @@ package prompt
import ( import (
"io" "io"
"github.com/mattn/go-colorable" colorable "github.com/mattn/go-colorable"
) )
// WindowsWriter is a ConsoleWriter implementation for Win32 console. // WindowsWriter is a ConsoleWriter implementation for Win32 console.

@ -3,7 +3,7 @@ package prompt
import ( import (
"runtime" "runtime"
"github.com/mattn/go-runewidth" runewidth "github.com/mattn/go-runewidth"
) )
// Render to render prompt information from state of Buffer. // Render to render prompt information from state of Buffer.