Skip to content

Commit

Permalink
Merge pull request #571 from restic/raise-go-version
Browse files Browse the repository at this point in the history
Require Go 1.6 or greater
  • Loading branch information
fd0 committed Aug 16, 2016
2 parents b108966 + 0434248 commit b5c3974
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 17 deletions.
12 changes: 3 additions & 9 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@ language: go
sudo: false

go:
- 1.3.3
- 1.4.3
- 1.5.4
- 1.6.2
- 1.6.3
- 1.7

os:
- linux
Expand All @@ -14,11 +12,7 @@ os:
matrix:
exclude:
- os: osx
go: 1.3.3
- os: osx
go: 1.4.3
- os: osx
go: 1.5.4
go: 1.6.3

notifications:
irc:
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

FROM ubuntu:14.04

ARG GOVERSION=1.6
ARG GOVERSION=1.7
ARG GOARCH=amd64

# install dependencies
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ latest released version.
Build restic
============

Install Go/Golang (at least version 1.3), then run `go run build.go`,
Install Go/Golang (at least version 1.6), then run `go run build.go`,
afterwards you'll find the binary in the current directory:

$ go run build.go
Expand Down
4 changes: 2 additions & 2 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ init:
install:
- rmdir c:\go /s /q
- appveyor DownloadFile https://storage.googleapis.com/golang/go1.6.1.windows-amd64.msi
- msiexec /i go1.6.1.windows-amd64.msi /q
- appveyor DownloadFile https://storage.googleapis.com/golang/go1.7.windows-amd64.msi
- msiexec /i go1.7.windows-amd64.msi /q
- go version
- go env
- appveyor DownloadFile http://sourceforge.netcologne.de/project/gnuwin32/tar/1.13-1/tar-1.13-1-bin.zip -FileName tar.zip
Expand Down
4 changes: 4 additions & 0 deletions build.go
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,10 @@ func (cs Constants) LDFlags() string {
}

func main() {
if runtime.Version() < "go1.6" {
fmt.Fprintf(os.Stderr, "old version of Go detected (%v), I'll try but no guarantees\n", runtime.Version())
}

buildTags := []string{}

skipNext := false
Expand Down
7 changes: 3 additions & 4 deletions run_integration_tests.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ func (env *TravisEnvironment) Prepare() error {
}
}

if *runCrossCompile {
if *runCrossCompile && !(runtime.Version() < "go1.7") {
// only test cross compilation on linux with Travis
if err := run("go", "get", "github.com/mitchellh/gox"); err != nil {
return err
Expand All @@ -191,8 +191,7 @@ func (env *TravisEnvironment) Prepare() error {

msg("gox: OS/ARCH %v\n", env.goxOSArch)

v := runtime.Version()
if !strings.HasPrefix(v, "go1.5") && !strings.HasPrefix(v, "go1.6") {
if runtime.Version() < "go1.5" {
err := run("gox", "-build-toolchain",
"-osarch", strings.Join(env.goxOSArch, " "))

Expand Down Expand Up @@ -318,7 +317,7 @@ func (env *TravisEnvironment) RunTests() error {

env.env["GOPATH"] = cwd + ":" + filepath.Join(cwd, "vendor")

if *runCrossCompile {
if *runCrossCompile && !(runtime.Version() < "go1.7") {
// compile for all target architectures with tags
for _, tags := range []string{"release", "debug"} {
runWithEnv(env.env, "gox", "-verbose",
Expand Down

0 comments on commit b5c3974

Please sign in to comment.