1
0
Fork 0
forked from forgejo/forgejo

[Vendor] Switch go-version lib (#12719)

* vendor: switch from "mcuadros/go-version" to "hashicorp/go-version"

* Adapt P1

* simplify

* fix lint

* adapt

* fix lint & rm old code

* no deadlock

* rm RWMutex and check GoVersion only 1-time

* Copyright header

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
This commit is contained in:
6543 2020-09-05 18:42:58 +02:00 committed by GitHub
parent 9fdb4f887b
commit bc11caff94
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
35 changed files with 1134 additions and 966 deletions

View file

@ -1,3 +1,4 @@
// Copyright 2020 The Gitea Authors. All rights reserved.
// Copyright 2015 The Gogs Authors. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
@ -11,12 +12,10 @@ import (
"io"
"os"
"os/exec"
"runtime"
"strings"
"time"
"code.gitea.io/gitea/modules/process"
"github.com/mcuadros/go-version"
)
var (
@ -132,7 +131,7 @@ func (c *Command) RunInDirTimeoutEnvFullPipelineFunc(env []string, timeout time.
}
// TODO: verify if this is still needed in golang 1.15
if version.Compare(runtime.Version(), "go1.15", "<") {
if goVersionLessThan115 {
cmd.Env = append(cmd.Env, "GODEBUG=asyncpreemptoff=1")
}
cmd.Dir = dir