Skip to content

Commit

Permalink
Remove go 1.15 support (go-gitea#18511)
Browse files Browse the repository at this point in the history
- Remove support for go 1.15(go.mod already requires go 1.16).

Co-authored-by: John Olheiser <[email protected]>
  • Loading branch information
Gusted and jolheiser authored Feb 1, 2022
1 parent 1de5028 commit f87d5ea
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 15 deletions.
4 changes: 0 additions & 4 deletions modules/git/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 0 additions & 11 deletions modules/git/git.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,6 @@ var (

gitVersion *version.Version

// will be checked on Init
goVersionLessThan115 = true

// SupportProcReceive version >= 2.29.0
SupportProcReceive bool
)
Expand Down Expand Up @@ -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": "[email protected]"} {
if err := checkAndSetConfig(configKey, defaultValue, false); err != nil {
Expand Down

0 comments on commit f87d5ea

Please sign in to comment.