Merge pull request #912 from restic/update-go

Update Go
This commit is contained in:
Alexander Neumann 2017-04-15 11:19:20 +02:00
commit e73038cbcb
3 changed files with 8 additions and 35 deletions

View file

@ -3,7 +3,7 @@ sudo: false
go: go:
- 1.7.5 - 1.7.5
- 1.8 - 1.8.1
- tip - tip
os: os:
@ -21,10 +21,10 @@ matrix:
- os: osx - os: osx
go: tip go: tip
- os: linux - os: linux
go: 1.8 go: 1.8.1
include: include:
- os: linux - os: linux
go: 1.8 go: 1.8.1
sudo: true sudo: true
env: env:
RESTIC_TEST_FUSE=1 RESTIC_TEST_FUSE=1

View file

@ -17,8 +17,8 @@ init:
install: install:
- rmdir c:\go /s /q - rmdir c:\go /s /q
- appveyor DownloadFile https://storage.googleapis.com/golang/go1.8.windows-amd64.msi - appveyor DownloadFile https://storage.googleapis.com/golang/go1.8.1.windows-amd64.msi
- msiexec /i go1.8.windows-amd64.msi /q - msiexec /i go1.8.1.windows-amd64.msi /q
- go version - go version
- go env - go env
- appveyor DownloadFile http://sourceforge.netcologne.de/project/gnuwin32/tar/1.13-1/tar-1.13-1-bin.zip -FileName tar.zip - appveyor DownloadFile http://sourceforge.netcologne.de/project/gnuwin32/tar/1.13-1/tar-1.13-1-bin.zip -FileName tar.zip

View file

@ -14,7 +14,6 @@ import (
"os" "os"
"os/exec" "os/exec"
"path/filepath" "path/filepath"
"regexp"
"runtime" "runtime"
"strings" "strings"
) )
@ -200,7 +199,7 @@ func (env *TravisEnvironment) Prepare() error {
return err return err
} }
if *runCrossCompile && !(runtime.Version() < "go1.7") { if *runCrossCompile {
// only test cross compilation on linux with Travis // only test cross compilation on linux with Travis
if err := run("go", "get", "github.com/mitchellh/gox"); err != nil { if err := run("go", "get", "github.com/mitchellh/gox"); err != nil {
return err return err
@ -212,25 +211,13 @@ func (env *TravisEnvironment) Prepare() error {
"darwin/386", "darwin/amd64", "darwin/386", "darwin/amd64",
"freebsd/386", "freebsd/amd64", "freebsd/386", "freebsd/amd64",
"openbsd/386", "openbsd/amd64", "openbsd/386", "openbsd/amd64",
} "linux/arm", "freebsd/arm",
if !strings.HasPrefix(runtime.Version(), "go1.3") {
env.goxOSArch = append(env.goxOSArch,
"linux/arm", "freebsd/arm")
} }
} else { } else {
env.goxOSArch = []string{runtime.GOOS + "/" + runtime.GOARCH} env.goxOSArch = []string{runtime.GOOS + "/" + runtime.GOARCH}
} }
msg("gox: OS/ARCH %v\n", env.goxOSArch) msg("gox: OS/ARCH %v\n", env.goxOSArch)
if runtime.Version() < "go1.5" {
err := run("gox", "-build-toolchain",
"-osarch", strings.Join(env.goxOSArch, " "))
if err != nil {
return err
}
}
} }
return nil return nil
@ -288,20 +275,6 @@ func (env *TravisEnvironment) Teardown() error {
return nil return nil
} }
func goVersionAtLeast151() bool {
v := runtime.Version()
if match, _ := regexp.MatchString(`^go1\.[0-4]`, v); match {
return false
}
if v == "go1.5" {
return false
}
return true
}
// Background is a program running in the background. // Background is a program running in the background.
type Background struct { type Background struct {
Cmd *exec.Cmd Cmd *exec.Cmd
@ -372,7 +345,7 @@ func (env *TravisEnvironment) RunTests() error {
env.env["GOPATH"] = cwd + ":" + filepath.Join(cwd, "vendor") env.env["GOPATH"] = cwd + ":" + filepath.Join(cwd, "vendor")
if *runCrossCompile && !(runtime.Version() < "go1.7") { if *runCrossCompile {
// compile for all target architectures with tags // compile for all target architectures with tags
for _, tags := range []string{"release", "debug"} { for _, tags := range []string{"release", "debug"} {
err := runWithEnv(env.env, "gox", "-verbose", err := runWithEnv(env.env, "gox", "-verbose",