Update Go and GolangCI-Lint

This commit is contained in:
Joel Speed 2020-03-29 12:53:22 +01:00
parent 362cdf7713
commit 8d69d55de4
No known key found for this signature in database
GPG Key ID: 6E80578D6751DEFB
7 changed files with 12 additions and 13 deletions

View File

@ -1,10 +1,9 @@
language: go
go:
- 1.13.x
- 1.14.x
install:
# Fetch dependencies
- curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $GOPATH/bin v1.23.6
- curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $GOPATH/bin v1.24.0
- GO111MODULE=on go mod download
script:
- ./configure && make test

View File

@ -1,7 +1,7 @@
FROM golang:1.14-buster AS builder
# Download tools
RUN curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(go env GOPATH)/bin v1.23.6
RUN curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(go env GOPATH)/bin v1.24.0
# Copy sources
WORKDIR $GOPATH/src/github.com/pusher/oauth2_proxy

View File

@ -1,7 +1,7 @@
FROM golang:1.14-buster AS builder
# Download tools
RUN curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(go env GOPATH)/bin v1.23.6
RUN curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(go env GOPATH)/bin v1.24.0
# Copy sources
WORKDIR $GOPATH/src/github.com/pusher/oauth2_proxy

View File

@ -1,7 +1,7 @@
FROM golang:1.14-buster AS builder
# Download tools
RUN curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(go env GOPATH)/bin v1.23.6
RUN curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(go env GOPATH)/bin v1.24.0
# Copy sources
WORKDIR $GOPATH/src/github.com/pusher/oauth2_proxy

8
configure vendored
View File

@ -5,8 +5,8 @@ GREEN='\033[0;32m'
BLUE='\033[0;34m'
NC='\033[0m'
if [ -z "${BASH_VERSINFO}" ] || [ -z "${BASH_VERSINFO[0]}" ] || [ ${BASH_VERSINFO[0]} -lt 4 ]; then
echo "This script requires Bash version >= 4"; exit 1;
if [ -z "${BASH_VERSINFO}" ] || [ -z "${BASH_VERSINFO[0]}" ] || [ ${BASH_VERSINFO[0]} -lt 4 ]; then
echo "This script requires Bash version >= 4"; exit 1;
fi
declare -A tools=()
@ -81,7 +81,7 @@ check_for() {
check_go_version() {
echo -n "Checking go version... "
GO_VERSION=$(${tools[go]} version | ${tools[awk]} '{where = match($0, /[0-9]\.[0-9]+\.[0-9]*/); if (where != 0) print substr($0, RSTART, RLENGTH)}')
vercomp $GO_VERSION 1.12
vercomp $GO_VERSION 1.14
case $? in
0) ;&
1)
@ -91,7 +91,7 @@ check_go_version() {
;;
2)
printf "${RED}"
echo "$GO_VERSION < 1.12"
echo "$GO_VERSION < 1.14"
exit 1
;;
esac

View File

@ -7,10 +7,10 @@ if [[ -z ${BINARY} ]] || [[ -z ${VERSION} ]]; then
exit 1
fi
# Check for Go version 1.13.*
# Check for Go version 1.14.*
GO_VERSION=$(go version | awk '{print $3}')
if [[ ! "${GO_VERSION}" =~ ^go1.13.* ]]; then
echo "Go version must be >= go1.13"
if [[ ! "${GO_VERSION}" =~ ^go1.14.* ]]; then
echo "Go version must be >= go1.14"
exit 1
fi

2
go.mod
View File

@ -1,6 +1,6 @@
module github.com/pusher/oauth2_proxy
go 1.13
go 1.14
require (
github.com/BurntSushi/toml v0.3.1