File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -70,11 +70,18 @@ function is_installed {
70
70
return 1
71
71
}
72
72
73
+ function golangci_lint_has_version {
74
+ # Trim "v" from version prefix since golangci-lint --version
75
+ # sometimes does not include it, depending on how it's built
76
+ golangci-lint --version | grep --quiet --fixed-strings " ${1# " v" } "
77
+ }
78
+
73
79
function fetch_go_tools {
74
- header_text " Checking for gometalinter.v2"
75
- if ! is_installed golangci-lint; then
80
+ header_text " Checking for golangci-lint"
81
+ local golangci_lint_version=" v1.21.0"
82
+ if ! is_installed golangci-lint || ! golangci_lint_has_version " ${golangci_lint_version} " ; then
76
83
header_text " Installing golangci-lint"
77
- curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh| sh -s -- -b $( go env GOPATH) /bin v1.21.0
84
+ curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh| sh -s -- -b $( go env GOPATH) /bin " ${golangci_lint_version} "
78
85
fi
79
86
}
80
87
You can’t perform that action at this time.
0 commit comments