Skip to content

Commit

Permalink
Merge pull request pfnet-research#32 from dtaniwaki/switch-to-go-modules
Browse files Browse the repository at this point in the history
Switch to go modules
  • Loading branch information
dtaniwaki committed May 14, 2019
2 parents b7da6b6 + 78a1f6f commit d7336fa
Show file tree
Hide file tree
Showing 23 changed files with 70 additions and 171 deletions.
10 changes: 4 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,12 @@ go:

go_import_path: github.com/pfnet-research/git-ghost

before_install:
- export PATH=$GOPATH/bin:$PATH
env:
- GO111MODULE=on

install:
- go get -u github.com/golang/dep/...
- go get -u github.com/golangci/golangci-lint/cmd/golangci-lint
- go get -u github.com/mattn/goveralls
- dep ensure
- go install github.com/golangci/golangci-lint/cmd/golangci-lint
- go install github.com/mattn/goveralls

before_script: make lint

Expand Down
121 changes: 0 additions & 121 deletions Gopkg.lock

This file was deleted.

19 changes: 0 additions & 19 deletions Gopkg.toml

This file was deleted.

12 changes: 4 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ guard-%:
fi

.PHONY: build
build: deps
build:
go build -tags netgo -installsuffix netgo $(LDFLAGS) -o $(OUTDIR)/$(NAME)

.PHONY: install
install: deps
install:
go install -tags netgo -installsuffix netgo $(LDFLAGS)

.PHONY: build-linux-amd64
Expand Down Expand Up @@ -92,13 +92,9 @@ release-image: guard-RELEASE_TAG
git checkout -

.PHONY: lint
lint: deps
lint:
golangci-lint run --config golangci.yml

.PHONY: deps
deps:
dep ensure

.PHONY: build-image-dev
build-image-dev:
docker build -t $(IMAGE_PREFIX)git-ghost-dev:$(IMAGE_TAG) --target git-ghost-dev $(PROJECTROOT)
Expand All @@ -110,7 +106,7 @@ build-image-cli:
.PHONY: build-image-all
build-image-all: build-image-dev build-image-cli

test: deps
test:
@go test -v -race -short -tags no_e2e ./...

.PHONY: shell
Expand Down
2 changes: 1 addition & 1 deletion cmd/pull.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
"github.com/pfnet-research/git-ghost/pkg/ghost/types"
"github.com/pfnet-research/git-ghost/pkg/util/errors"

log "github.com/Sirupsen/logrus"
log "github.com/sirupsen/logrus"
"github.com/spf13/cobra"
)

Expand Down
2 changes: 1 addition & 1 deletion cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
"github.com/pfnet-research/git-ghost/pkg/ghost/types"
"github.com/pfnet-research/git-ghost/pkg/util/errors"

log "github.com/Sirupsen/logrus"
log "github.com/sirupsen/logrus"
"github.com/spf13/cobra"
)

Expand Down
2 changes: 1 addition & 1 deletion cmd/show.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
"github.com/pfnet-research/git-ghost/pkg/ghost/types"
"github.com/pfnet-research/git-ghost/pkg/util/errors"

log "github.com/Sirupsen/logrus"
log "github.com/sirupsen/logrus"
"github.com/spf13/cobra"
)

Expand Down
13 changes: 13 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
module github.com/pfnet-research/git-ghost

require (
github.com/hashicorp/go-multierror v1.0.0
github.com/inconshreveable/mousetrap v1.0.0 // indirect
github.com/pkg/errors v0.8.1
github.com/sirupsen/logrus v1.3.0
github.com/spf13/cobra v0.0.0-20190109003409-7547e83b2d85
github.com/spf13/pflag v1.0.3 // indirect
github.com/stretchr/testify v1.3.0
golang.org/x/crypto v0.0.0-20190128193316-c7b33c32a30b // indirect
golang.org/x/sys v0.0.0-20190124100055-b90733256f2e // indirect
)
32 changes: 32 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/hashicorp/errwrap v1.0.0 h1:hLrqtEDnRye3+sgx6z4qVLNuviH3MR5aQ0ykNJa/UYA=
github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
github.com/hashicorp/go-multierror v1.0.0 h1:iVjPR7a6H0tWELX5NxNe7bYopibicUzc7uPribsnS6o=
github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk=
github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM=
github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8=
github.com/konsorten/go-windows-terminal-sequences v1.0.1 h1:mweAR1A6xJ3oS2pRaGiHgQ4OO8tzTaLawm8vnODuwDk=
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I=
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/sirupsen/logrus v1.3.0 h1:hI/7Q+DtNZ2kINb6qt/lS+IyXnHQe9e90POfeewL/ME=
github.com/sirupsen/logrus v1.3.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo=
github.com/spf13/cobra v0.0.0-20190109003409-7547e83b2d85 h1:UQHWkFUuJBy5rWN1DxosG/efssLu7u0fXXSTC2HHKfQ=
github.com/spf13/cobra v0.0.0-20190109003409-7547e83b2d85/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ=
github.com/spf13/pflag v1.0.3 h1:zPAT6CGy6wXeQ7NtTnaTerfKOsV6V6F8agHXFiazDkg=
github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20190128193316-c7b33c32a30b h1:Ib/yptP38nXZFMwqWSip+OKuMP9OkyDe3p+DssP8n9w=
golang.org/x/crypto v0.0.0-20190128193316-c7b33c32a30b/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190124100055-b90733256f2e h1:3GIlrlVLfkoipSReOMNAgApI0ajnalyLa/EZHHca/XI=
golang.org/x/sys v0.0.0-20190124100055-b90733256f2e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (

"github.com/pfnet-research/git-ghost/cmd"

log "github.com/Sirupsen/logrus"
log "github.com/sirupsen/logrus"
)

func init() {
Expand Down
2 changes: 1 addition & 1 deletion pkg/ghost/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (
"github.com/pfnet-research/git-ghost/pkg/util"
"github.com/pfnet-research/git-ghost/pkg/util/errors"

log "github.com/Sirupsen/logrus"
log "github.com/sirupsen/logrus"
)

// DeleteOptions represents arg for Delete func
Expand Down
2 changes: 1 addition & 1 deletion pkg/ghost/git/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ import (
"github.com/pfnet-research/git-ghost/pkg/util"
"github.com/pfnet-research/git-ghost/pkg/util/errors"

log "github.com/Sirupsen/logrus"
multierror "github.com/hashicorp/go-multierror"
log "github.com/sirupsen/logrus"
)

// CreateDiffBundleFile creates patches for fromCommittish..toCommittish and save it to filepath
Expand Down
2 changes: 1 addition & 1 deletion pkg/ghost/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (
"github.com/pfnet-research/git-ghost/pkg/util"
"github.com/pfnet-research/git-ghost/pkg/util/errors"

log "github.com/Sirupsen/logrus"
log "github.com/sirupsen/logrus"
)

// ListOptions represents arg for List func
Expand Down
2 changes: 1 addition & 1 deletion pkg/ghost/pull.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (
"github.com/pfnet-research/git-ghost/pkg/util"
"github.com/pfnet-research/git-ghost/pkg/util/errors"

log "github.com/Sirupsen/logrus"
log "github.com/sirupsen/logrus"
)

// PullOptions represents arg for Pull func
Expand Down
2 changes: 1 addition & 1 deletion pkg/ghost/push.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
"github.com/pfnet-research/git-ghost/pkg/util"
"github.com/pfnet-research/git-ghost/pkg/util/errors"

log "github.com/Sirupsen/logrus"
log "github.com/sirupsen/logrus"
)

// PushOptions represents arg for Push func
Expand Down
2 changes: 1 addition & 1 deletion pkg/ghost/show.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
"github.com/pfnet-research/git-ghost/pkg/util"
"github.com/pfnet-research/git-ghost/pkg/util/errors"

log "github.com/Sirupsen/logrus"
log "github.com/sirupsen/logrus"
)

// ShowOptions represents arg for Pull func
Expand Down
2 changes: 1 addition & 1 deletion pkg/ghost/types/branch.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import (
"github.com/pfnet-research/git-ghost/pkg/util"
"github.com/pfnet-research/git-ghost/pkg/util/errors"

log "github.com/Sirupsen/logrus"
log "github.com/sirupsen/logrus"
)

// GhostBranch is an interface representing a ghost branch.
Expand Down
2 changes: 1 addition & 1 deletion pkg/ghost/types/branchspec.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ import (
"github.com/pfnet-research/git-ghost/pkg/util"
"github.com/pfnet-research/git-ghost/pkg/util/errors"

log "github.com/Sirupsen/logrus"
multierror "github.com/hashicorp/go-multierror"
log "github.com/sirupsen/logrus"
)

// GhostBranchSpec is an interface
Expand Down
2 changes: 1 addition & 1 deletion pkg/ghost/types/workingenv.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
"github.com/pfnet-research/git-ghost/pkg/ghost/git"
"github.com/pfnet-research/git-ghost/pkg/util/errors"

log "github.com/Sirupsen/logrus"
log "github.com/sirupsen/logrus"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion pkg/util/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ package util
import (
"github.com/pfnet-research/git-ghost/pkg/util/errors"

log "github.com/Sirupsen/logrus"
log "github.com/sirupsen/logrus"
)

// LogDeferredError calls a given function and log an error according to the result
Expand Down
2 changes: 1 addition & 1 deletion pkg/util/errors/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (

"github.com/pkg/errors"

log "github.com/Sirupsen/logrus"
log "github.com/sirupsen/logrus"
)

type GitGhostError interface {
Expand Down
2 changes: 1 addition & 1 deletion pkg/util/exec.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (

"github.com/pfnet-research/git-ghost/pkg/util/errors"

log "github.com/Sirupsen/logrus"
log "github.com/sirupsen/logrus"
)

func JustOutputCmd(cmd *exec.Cmd) ([]byte, errors.GitGhostError) {
Expand Down
Loading

0 comments on commit d7336fa

Please sign in to comment.