mirror of
https://github.com/octoleo/restic.git
synced 2024-11-29 16:23:59 +00:00
Travis: Run with -mod=vendor only for Go >= 1.11
This commit is contained in:
parent
e9a764129f
commit
e4cdb0eab3
@ -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
|
// 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
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -342,8 +349,6 @@ func (env *TravisEnvironment) RunTests() error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// only run gofmt on a specific version of Go.
|
// 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 v.AtLeast(GofmtVersion) {
|
||||||
if err = runGofmt(); err != nil {
|
if err = runGofmt(); err != nil {
|
||||||
return err
|
return err
|
||||||
|
Loading…
Reference in New Issue
Block a user