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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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