misc, docs: Update minimum required golang version to 1.13
This commit is contained in:
committed by
James Shubin
parent
d75f763c99
commit
274e01bb75
10
.travis.yml
10
.travis.yml
@@ -24,21 +24,21 @@ install: 'make deps'
|
|||||||
matrix:
|
matrix:
|
||||||
fast_finish: false
|
fast_finish: false
|
||||||
allow_failures:
|
allow_failures:
|
||||||
- go: 1.13.x
|
- go: 1.14.x
|
||||||
- go: tip
|
- go: tip
|
||||||
- os: osx
|
- os: osx
|
||||||
# include only one build for osx for a quicker build as the nr. of these runners are sparse
|
# include only one build for osx for a quicker build as the nr. of these runners are sparse
|
||||||
include:
|
include:
|
||||||
- name: "basic tests"
|
- name: "basic tests"
|
||||||
go: 1.12.x
|
go: 1.13.x
|
||||||
env: TEST_BLOCK=basic
|
env: TEST_BLOCK=basic
|
||||||
- name: "shell tests"
|
- name: "shell tests"
|
||||||
go: 1.12.x
|
go: 1.13.x
|
||||||
env: TEST_BLOCK=shell
|
env: TEST_BLOCK=shell
|
||||||
- name: "race tests"
|
- name: "race tests"
|
||||||
go: 1.12.x
|
go: 1.13.x
|
||||||
env: TEST_BLOCK=race
|
env: TEST_BLOCK=race
|
||||||
- go: 1.13.x
|
- go: 1.14.x
|
||||||
- go: tip
|
- go: tip
|
||||||
- os: osx
|
- os: osx
|
||||||
script: 'TEST_BLOCK="$TEST_BLOCK" make test'
|
script: 'TEST_BLOCK="$TEST_BLOCK" make test'
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
FROM golang:1.12
|
FROM golang:1.13
|
||||||
|
|
||||||
MAINTAINER Michał Czeraszkiewicz <contact@czerasz.com>
|
MAINTAINER Michał Czeraszkiewicz <contact@czerasz.com>
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
FROM golang:1.12
|
FROM golang:1.13
|
||||||
|
|
||||||
MAINTAINER Michał Czeraszkiewicz <contact@czerasz.com>
|
MAINTAINER Michał Czeraszkiewicz <contact@czerasz.com>
|
||||||
|
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ required for running the _test_ suite.
|
|||||||
|
|
||||||
### Build
|
### Build
|
||||||
|
|
||||||
* `golang` 1.12 or higher (required, available in some distros and distributed
|
* `golang` 1.13 or higher (required, available in some distros and distributed
|
||||||
as a binary officially by [golang.org](https://golang.org/dl/))
|
as a binary officially by [golang.org](https://golang.org/dl/))
|
||||||
|
|
||||||
### Runtime
|
### Runtime
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ You'll need some dependencies, including `golang`, and some associated tools.
|
|||||||
|
|
||||||
#### Installing golang
|
#### Installing golang
|
||||||
|
|
||||||
* You need golang version 1.12 or greater installed.
|
* You need golang version 1.13 or greater installed.
|
||||||
* To install on rpm style systems: `sudo dnf install golang`
|
* To install on rpm style systems: `sudo dnf install golang`
|
||||||
* To install on apt style systems: `sudo apt install golang`
|
* To install on apt style systems: `sudo apt install golang`
|
||||||
* To install on macOS systems install [Homebrew](https://brew.sh)
|
* To install on macOS systems install [Homebrew](https://brew.sh)
|
||||||
|
|||||||
@@ -19,6 +19,14 @@ NEWAPT=`command -v apt 2>/dev/null`
|
|||||||
BREW=`command -v brew 2>/dev/null`
|
BREW=`command -v brew 2>/dev/null`
|
||||||
PACMAN=`command -v pacman 2>/dev/null`
|
PACMAN=`command -v pacman 2>/dev/null`
|
||||||
|
|
||||||
|
# set minimum go version and installed go version
|
||||||
|
mingoversion=13
|
||||||
|
goversion=0
|
||||||
|
if [ -x "$GO" ]; then
|
||||||
|
# capture the minor version number
|
||||||
|
goversion=$(go version | grep -o -P '(?<=go1\.)[0-9]*')
|
||||||
|
fi
|
||||||
|
|
||||||
# if DNF is available use it
|
# if DNF is available use it
|
||||||
if [ -x "$DNF" ]; then
|
if [ -x "$DNF" ]; then
|
||||||
YUM=$DNF
|
YUM=$DNF
|
||||||
@@ -97,7 +105,7 @@ if [ $travis -eq 0 ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# attempt to workaround old ubuntu
|
# attempt to workaround old ubuntu
|
||||||
if [ ! -z "$APT" ] && go version | grep -e 'go1\.[0123456789]\.' -e 'go1\.10\.'; then
|
if [ ! -z "$APT" ] && [ "$goversion" -lt "$mingoversion" ]; then
|
||||||
echo "install golang from a ppa."
|
echo "install golang from a ppa."
|
||||||
$sudo_command $APT remove -y golang
|
$sudo_command $APT remove -y golang
|
||||||
$sudo_command $APT install -y software-properties-common # for add-apt-repository
|
$sudo_command $APT install -y software-properties-common # for add-apt-repository
|
||||||
@@ -107,8 +115,8 @@ if [ ! -z "$APT" ] && go version | grep -e 'go1\.[0123456789]\.' -e 'go1\.10\.';
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# if golang is too old, we don't want to fail with an obscure error later
|
# if golang is too old, we don't want to fail with an obscure error later
|
||||||
if go version | grep -e 'go1\.[0123456789]\.' -e 'go1\.10\.'; then
|
if [ "$goversion" -lt "$mingoversion" ]; then
|
||||||
echo "mgmt recommends go1.11 or higher."
|
echo "mgmt recommends go1.$mingoversion or higher."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user