Fix goimports violations

This commit is contained in:
Justin Li 2018-10-23 14:06:52 -04:00
parent f19f08aa2e
commit 3c80ed8a8e
6 changed files with 13 additions and 9 deletions

View file

@ -13,7 +13,7 @@ matrix:
- dep ensure - dep ensure
- go test -v $(go list ./...) - go test -v $(go list ./...)
- go vet $(go list ./...) - go vet $(go list ./...)
- diff <(goimports -d $(find . -type f -name '*.go' -not -path "./vendor/*")) <(printf "") - diff <(goimports -local github.com/chihaya/chihaya -d $(find . -type f -name '*.go' -not -path "./vendor/*")) <(printf "")
- (for d in $(go list ./...); do diff <(golint $d) <(printf "") || exit 1; done) - (for d in $(go list ./...); do diff <(golint $d) <(printf "") || exit 1; done)
- go install github.com/chihaya/chihaya/cmd/chihaya - go install github.com/chihaya/chihaya/cmd/chihaya
- chihaya --config=example_config.yaml --debug& - chihaya --config=example_config.yaml --debug&
@ -29,7 +29,7 @@ matrix:
script: script:
- go test -v $(go list ./...) - go test -v $(go list ./...)
- go vet $(go list ./...) - go vet $(go list ./...)
- diff <(goimports -d $(find . -type f -name '*.go' -not -path "./vendor/*")) <(printf "") - diff <(goimports -local github.com/chihaya/chihaya -d $(find . -type f -name '*.go' -not -path "./vendor/*")) <(printf "")
- (for d in $(go list ./...); do diff <(golint $d) <(printf "") || exit 1; done) - (for d in $(go list ./...); do diff <(golint $d) <(printf "") || exit 1; done)
- go install github.com/chihaya/chihaya/cmd/chihaya - go install github.com/chihaya/chihaya/cmd/chihaya
- chihaya --config=example_config.yaml --debug& - chihaya --config=example_config.yaml --debug&
@ -46,7 +46,7 @@ matrix:
script: script:
- go test -v $(go list ./...) - go test -v $(go list ./...)
- go vet $(go list ./...) - go vet $(go list ./...)
- diff <(goimports -d $(find . -type f -name '*.go' -not -path "./vendor/*")) <(printf "") - diff <(goimports -local github.com/chihaya/chihaya -d $(find . -type f -name '*.go' -not -path "./vendor/*")) <(printf "")
- (for d in $(go list ./...); do diff <(golint $d) <(printf "") || exit 1; done) - (for d in $(go list ./...); do diff <(golint $d) <(printf "") || exit 1; done)
- go install github.com/chihaya/chihaya/cmd/chihaya - go install github.com/chihaya/chihaya/cmd/chihaya
- chihaya --config=example_config.yaml --debug& - chihaya --config=example_config.yaml --debug&

View file

@ -10,14 +10,18 @@ import (
"github.com/chihaya/chihaya/frontend/http" "github.com/chihaya/chihaya/frontend/http"
"github.com/chihaya/chihaya/frontend/udp" "github.com/chihaya/chihaya/frontend/udp"
"github.com/chihaya/chihaya/middleware" "github.com/chihaya/chihaya/middleware"
)
// Imported to register as middleware drivers. import (
// Imports to register middleware drivers.
_ "github.com/chihaya/chihaya/middleware/clientapproval" _ "github.com/chihaya/chihaya/middleware/clientapproval"
_ "github.com/chihaya/chihaya/middleware/jwt" _ "github.com/chihaya/chihaya/middleware/jwt"
_ "github.com/chihaya/chihaya/middleware/torrentapproval" _ "github.com/chihaya/chihaya/middleware/torrentapproval"
_ "github.com/chihaya/chihaya/middleware/varinterval" _ "github.com/chihaya/chihaya/middleware/varinterval"
)
// Imported to register as storage drivers. import (
// Imports to register storage drivers.
_ "github.com/chihaya/chihaya/storage/memory" _ "github.com/chihaya/chihaya/storage/memory"
_ "github.com/chihaya/chihaya/storage/memorybysubnet" _ "github.com/chihaya/chihaya/storage/memorybysubnet"
) )

View file

@ -10,7 +10,6 @@ import (
"time" "time"
"github.com/minio/sha256-simd" "github.com/minio/sha256-simd"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
"github.com/chihaya/chihaya/pkg/log" "github.com/chihaya/chihaya/pkg/log"

View file

@ -5,8 +5,9 @@ import (
"fmt" "fmt"
"testing" "testing"
"github.com/chihaya/chihaya/bittorrent"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
"github.com/chihaya/chihaya/bittorrent"
) )
var configTests = []struct { var configTests = []struct {

View file

@ -6,9 +6,10 @@ import (
"context" "context"
"net/http" "net/http"
"github.com/prometheus/client_golang/prometheus"
"github.com/chihaya/chihaya/pkg/log" "github.com/chihaya/chihaya/pkg/log"
"github.com/chihaya/chihaya/pkg/stop" "github.com/chihaya/chihaya/pkg/stop"
"github.com/prometheus/client_golang/prometheus"
) )
// Server represents a standalone HTTP server for serving a Prometheus metrics // Server represents a standalone HTTP server for serving a Prometheus metrics

View file

@ -2,7 +2,6 @@ package memory
import ( import (
"testing" "testing"
"time" "time"
s "github.com/chihaya/chihaya/storage" s "github.com/chihaya/chihaya/storage"