mirror of
https://github.com/restic/restic.git
synced 2024-12-24 00:37:28 +00:00
Travis: Run with -mod=vendor only for Go >= 1.11
This commit is contained in:
parent
e9a764129f
commit
e4cdb0eab3
1 changed files with 8 additions and 3 deletions
|
@ -330,8 +330,15 @@ func (env *TravisEnvironment) RunTests() error {
|
|||
}
|
||||
}
|
||||
|
||||
args := []string{"go", "run", "build.go"}
|
||||
v := ParseGoVersion(runtime.Version())
|
||||
msg("Detected Go version %v\n", v)
|
||||
if v.AtLeast(GoVersion{1, 11, 0}) {
|
||||
args = []string{"go", "run", "-mod=vendor", "build.go"}
|
||||
}
|
||||
|
||||
// run the build script
|
||||
if err := run("go", "run", "-mod=vendor", "build.go"); err != nil {
|
||||
if err := run(args[0], args[1:]...); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
|
@ -342,8 +349,6 @@ func (env *TravisEnvironment) RunTests() error {
|
|||
}
|
||||
|
||||
// only run gofmt on a specific version of Go.
|
||||
v := ParseGoVersion(runtime.Version())
|
||||
msg("Detected Go version %v\n", v)
|
||||
if v.AtLeast(GofmtVersion) {
|
||||
if err = runGofmt(); err != nil {
|
||||
return err
|
||||
|
|
Loading…
Reference in a new issue