]> source.dussan.org Git - gitea.git/commitdiff
Remove go 1.15 support (#18511)
authorGusted <williamzijl7@hotmail.com>
Tue, 1 Feb 2022 02:46:45 +0000 (03:46 +0100)
committerGitHub <noreply@github.com>
Tue, 1 Feb 2022 02:46:45 +0000 (10:46 +0800)
- Remove support for go 1.15(go.mod already requires go 1.16).

Co-authored-by: John Olheiser <john.olheiser@gmail.com>
modules/git/command.go
modules/git/git.go

index e8afaa0e46c16fcf71667f08316af6c4f9a9ddfa..79d86bd90b77fc66beb95d112fe2ef682e784ecf 100644 (file)
@@ -165,10 +165,6 @@ func (c *Command) RunWithContext(rc *RunContext) error {
                "GIT_TERMINAL_PROMPT=0",
        )
 
-       // TODO: verify if this is still needed in golang 1.15
-       if goVersionLessThan115 {
-               cmd.Env = append(cmd.Env, "GODEBUG=asyncpreemptoff=1")
-       }
        cmd.Dir = rc.Dir
        cmd.Stdout = rc.Stdout
        cmd.Stderr = rc.Stderr
index 217e6955c2bc28a1faff837eca3b3b7a7f9bb9bb..8b29bee4729a217eaccaf297f9f8480ab814a050 100644 (file)
@@ -35,9 +35,6 @@ var (
 
        gitVersion *version.Version
 
-       // will be checked on Init
-       goVersionLessThan115 = true
-
        // SupportProcReceive version >= 2.29.0
        SupportProcReceive bool
 )
@@ -156,14 +153,6 @@ func Init(ctx context.Context) error {
                return err
        }
 
-       // Save if the go version used to compile gitea is greater or equal 1.15
-       runtimeVersion, err := version.NewVersion(strings.TrimPrefix(runtime.Version(), "go"))
-       if err != nil {
-               return err
-       }
-       version115, _ := version.NewVersion("1.15")
-       goVersionLessThan115 = runtimeVersion.LessThan(version115)
-
        // Git requires setting user.name and user.email in order to commit changes - if they're not set just add some defaults
        for configKey, defaultValue := range map[string]string{"user.name": "Gitea", "user.email": "gitea@fake.local"} {
                if err := checkAndSetConfig(configKey, defaultValue, false); err != nil {