misc, docs: Move to golang 1.12

This commit is contained in:
James Shubin
2020-09-23 11:34:25 -04:00
parent 5bc985663c
commit d75f763c99
7 changed files with 15 additions and 15 deletions

View File

@@ -24,21 +24,21 @@ install: 'make deps'
matrix: matrix:
fast_finish: false fast_finish: false
allow_failures: allow_failures:
- go: 1.12.x - go: 1.13.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.11.x go: 1.12.x
env: TEST_BLOCK=basic env: TEST_BLOCK=basic
- name: "shell tests" - name: "shell tests"
go: 1.11.x go: 1.12.x
env: TEST_BLOCK=shell env: TEST_BLOCK=shell
- name: "race tests" - name: "race tests"
go: 1.11.x go: 1.12.x
env: TEST_BLOCK=race env: TEST_BLOCK=race
- go: 1.12.x - go: 1.13.x
- go: tip - go: tip
- os: osx - os: osx
script: 'TEST_BLOCK="$TEST_BLOCK" make test' script: 'TEST_BLOCK="$TEST_BLOCK" make test'

View File

@@ -1,10 +1,10 @@
FROM golang:1.9 FROM golang:1.12
MAINTAINER Michał Czeraszkiewicz <contact@czerasz.com> MAINTAINER Michał Czeraszkiewicz <contact@czerasz.com>
# Set the reset cache variable # Set the reset cache variable
# Read more here: http://czerasz.com/2014/11/13/docker-tip-and-tricks/#use-refreshedat-variable-for-better-cache-control # Read more here: http://czerasz.com/2014/11/13/docker-tip-and-tricks/#use-refreshedat-variable-for-better-cache-control
ENV REFRESHED_AT 2017-11-16 ENV REFRESHED_AT 2020-09-23
# Update the package list to be able to use required packages # Update the package list to be able to use required packages
RUN apt-get update RUN apt-get update

View File

@@ -1,4 +1,4 @@
FROM golang:1.11 FROM golang:1.12
MAINTAINER Michał Czeraszkiewicz <contact@czerasz.com> MAINTAINER Michał Czeraszkiewicz <contact@czerasz.com>

View File

@@ -28,7 +28,7 @@ required for running the _test_ suite.
### Build ### Build
* `golang` 1.11 or higher (required, available in some distros and distributed * `golang` 1.12 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

View File

@@ -37,7 +37,7 @@ You'll need some dependencies, including `golang`, and some associated tools.
#### Installing golang #### Installing golang
* You need golang version 1.11 or greater installed. * You need golang version 1.12 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)

View File

@@ -43,7 +43,7 @@ const (
// false if not. // false if not.
func modeIsValidWho(who string) bool { func modeIsValidWho(who string) bool {
for _, w := range []string{"u", "g", "o"} { for _, w := range []string{"u", "g", "o"} {
who = strings.Replace(who, w, "", -1) // TODO: use ReplaceAll in 1.12 who = strings.ReplaceAll(who, w, "")
} }
return len(who) == 0 return len(who) == 0
} }
@@ -52,7 +52,7 @@ func modeIsValidWho(who string) bool {
// string ('r', 'w', 'x', 's', 't'). // string ('r', 'w', 'x', 's', 't').
func modeIsValidWhat(what string) bool { func modeIsValidWhat(what string) bool {
for _, w := range []string{"r", "w", "x", "s", "t"} { for _, w := range []string{"r", "w", "x", "s", "t"} {
what = strings.Replace(what, w, "", -1) // TODO: use ReplaceAll in 1.12 what = strings.ReplaceAll(what, w, "")
} }
return len(what) == 0 return len(what) == 0
} }

View File

@@ -70,9 +70,9 @@ func ResPathUID(res engine.Res) string {
// a name of: /tmp/mgmt/foo is /tmp-mgmt-foo and // a name of: /tmp/mgmt/foo is /tmp-mgmt-foo and
// a name of: /tmp/mgmt-foo -> /tmp-mgmt-foo if we replace slashes. // a name of: /tmp/mgmt-foo -> /tmp-mgmt-foo if we replace slashes.
// As a result, we base64 encode (but without slashes). // As a result, we base64 encode (but without slashes).
name := strings.Replace(res.Name(), "/", "-", -1) // TODO: use ReplaceAll in 1.12 name := strings.ReplaceAll(res.Name(), "/", "-")
if os.PathSeparator != '/' { // lol windows? if os.PathSeparator != '/' { // lol windows?
name = strings.Replace(name, string(os.PathSeparator), "-", -1) // TODO: use ReplaceAll in 1.12 name = strings.ReplaceAll(name, string(os.PathSeparator), "-")
} }
b := []byte(res.Name()) b := []byte(res.Name())
encoded := base64.URLEncoding.EncodeToString(b) encoded := base64.URLEncoding.EncodeToString(b)