-
Notifications
You must be signed in to change notification settings - Fork 569
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Go Modules #347
Merged
Merged
Go Modules #347
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This PR included gometalinter and go module changes, so it can be divided. |
paveg
commented
Sep 21, 2019
# Gometalinter is deprecated and broken dependency so let's use with GO111MODULE=off | ||
prepare.metalinter: | ||
GO111MODULE=off go get -u github.com/alecthomas/gometalinter | ||
GO111MODULE=off gometalinter --fast --install |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried to installed into BIN_DIR
, so go-i18n v2 is broken.
# GO111MODULE=auto
$ go get -u github.com/alecthomas/gometalinter
go: finding github.com/google/shlex latest
go: finding gopkg.in/alecthomas/kingpin.v3-unstable latest
go: finding github.com/alecthomas/units latest
build github.com/alecthomas/gometalinter: cannot load github.com/nicksnyder/go-i18n/i18n: module github.com/nicksnyder/go-i18n@latest (v2.0.2+incompatible) found, but does not contain package github.com/nicksnyder/go-i18n/i18n
and I executed requiring go-i18n@v1.10.1
but it was failed.
$ go mod edit -require github.com/nicksnyder/go-i18n@v1.10.1
~/src/github.com/Versent/saml2aws modules*
$ make prepare
GOBIN=/Users/ryota/src/github.com/Versent/saml2aws/bin go install github.com/buildkite/github-release
go: finding github.com/buildkite/github-release latest
go: finding golang.org/x/oauth2 latest
GOBIN=/Users/ryota/src/github.com/Versent/saml2aws/bin go install github.com/mitchellh/gox
GOBIN=/Users/ryota/src/github.com/Versent/saml2aws/bin go install github.com/axw/gocov/gocov
GOBIN=/Users/ryota/src/github.com/Versent/saml2aws/bin go install golang.org/x/tools/cmd/cover
GOBIN=/Users/ryota/src/github.com/Versent/saml2aws/bin go install github.com/alecthomas/gometalinter
go: finding gopkg.in/alecthomas/kingpin.v3-unstable latest
go: finding github.com/google/shlex latest
# github.com/alecthomas/gometalinter
../../../../pkg/mod/github.com/alecthomas/gometalinter@v3.0.0+incompatible/main.go:36:94: cannot use loadConfig (type func(*kingpin.Application, *kingpin.ParseElement, *kingpin.ParseContext) error) as type kingpin.Action in argument to app.cmdMixin.flagGroup.Flag("config", "Load JSON configuration from file.").Envar("GOMETALINTER_CONFIG").Action
../../../../pkg/mod/github.com/alecthomas/gometalinter@v3.0.0+incompatible/main.go:38:100: cannot use disableAction (type func(*kingpin.Application, *kingpin.ParseElement, *kingpin.ParseContext) error) as type kingpin.Action in argument to app.cmdMixin.flagGroup.Flag("disable", "Disable previously enabled linters.").PlaceHolder("LINTER").Short('D').Action
../../../../pkg/mod/github.com/alecthomas/gometalinter@v3.0.0+incompatible/main.go:39:99: cannot use enableAction (type func(*kingpin.Application, *kingpin.ParseElement, *kingpin.ParseContext) error) as type kingpin.Action in argument to app.cmdMixin.flagGroup.Flag("enable", "Enable previously disabled linters.").PlaceHolder("LINTER").Short('E').Action
../../../../pkg/mod/github.com/alecthomas/gometalinter@v3.0.0+incompatible/main.go:40:83: cannot use cliLinterOverrides (type func(*kingpin.Application, *kingpin.ParseElement, *kingpin.ParseContext) error) as type kingpin.Action in argument to app.cmdMixin.flagGroup.Flag("linter", "Define a linter.").PlaceHolder("NAME:COMMAND:PATTERN").Action
../../../../pkg/mod/github.com/alecthomas/gometalinter@v3.0.0+incompatible/main.go:43:56: cannot use disableAllAction (type func(*kingpin.Application, *kingpin.ParseElement, *kingpin.ParseContext) error) as type kingpin.Action in argument to app.cmdMixin.flagGroup.Flag("disable-all", "Disable all linters.").Action
../../../../pkg/mod/github.com/alecthomas/gometalinter@v3.0.0+incompatible/main.go:44:54: cannot use enableAllAction (type func(*kingpin.Application, *kingpin.ParseElement, *kingpin.ParseContext) error) as type kingpin.Action in argument to app.cmdMixin.flagGroup.Flag("enable-all", "Enable all linters.").Action
../../../../pkg/mod/github.com/alecthomas/gometalinter@v3.0.0+incompatible/main.go:200:12: cannot use loadDefaultConfig (type func(*kingpin.Application, *kingpin.ParseElement, *kingpin.ParseContext) error) as type kingpin.Action in argument to app.Action
make: *** [prepare] Error 2
differences is below:
$ git diff
diff --git a/Makefile b/Makefile
index 4cdb3bc..d47d863 100644
--- a/Makefile
+++ b/Makefile
@@ -11,16 +11,12 @@ BIN_DIR := $(CURDIR)/bin
ci: prepare test
-prepare: prepare.metalinter
+prepare:
GOBIN=$(BIN_DIR) go install github.com/buildkite/github-release
GOBIN=$(BIN_DIR) go install github.com/mitchellh/gox
GOBIN=$(BIN_DIR) go install github.com/axw/gocov/gocov
GOBIN=$(BIN_DIR) go install golang.org/x/tools/cmd/cover
-
-# Gometalinter is deprecated and broken dependency so let's use with GO111MODULE=off
-prepare.metalinter:
- GO111MODULE=off go get -u github.com/alecthomas/gometalinter
- GO111MODULE=off gometalinter --fast --install
+ GOBIN=$(BIN_DIR) go install github.com/alecthomas/gometalinter
mod:
@go mod download
@@ -39,7 +35,7 @@ compile: mod
# Run all the linters
lint:
- @gometalinter --vendor ./...
+ @$(BIN_DIR)/gometalinter --vendor ./...
# gofmt and goimports all go files
fmt:
@@ -78,4 +74,4 @@ packages:
generate-mocks:
mockery -dir pkg/prompter --all
-.PHONY: default prepare.metalinter prepare mod compile lint fmt dist release test clean generate-mocks
+.PHONY: default prepare mod compile lint fmt dist release test clean generate-mocks
Closed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
use golangci-lintFix code stylesconfigured disable rulesunusedstructcheckineffassigngoveterrcheckdep is old so let's migrate.
now, this PR is working in progress.
Please merge, if possible.