Skip to content

Commit a346a8c

Browse files
bump to use go 1.22 (#29119)
1 parent 155269f commit a346a8c

File tree

13 files changed

+54
-54
lines changed

13 files changed

+54
-54
lines changed

.devcontainer/devcontainer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "Gitea DevContainer",
3-
"image": "mcr.microsoft.com/devcontainers/go:1.21-bullseye",
3+
"image": "mcr.microsoft.com/devcontainers/go:1.22-bullseye",
44
"features": {
55
// installs nodejs into container
66
"ghcr.io/devcontainers/features/node:1": {

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Build stage
2-
FROM docker.io/library/golang:1.21-alpine3.19 AS build-env
2+
FROM docker.io/library/golang:1.22-alpine3.19 AS build-env
33

44
ARG GOPROXY
55
ENV GOPROXY ${GOPROXY:-direct}

Dockerfile.rootless

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Build stage
2-
FROM docker.io/library/golang:1.21-alpine3.19 AS build-env
2+
FROM docker.io/library/golang:1.22-alpine3.19 AS build-env
33

44
ARG GOPROXY
55
ENV GOPROXY ${GOPROXY:-direct}

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@ SHASUM ?= shasum -a 256
2323
HAS_GO := $(shell hash $(GO) > /dev/null 2>&1 && echo yes)
2424
COMMA := ,
2525

26-
XGO_VERSION := go-1.21.x
26+
XGO_VERSION := go-1.22.x
2727

2828
AIR_PACKAGE ?= github.com/cosmtrek/[email protected]
2929
EDITORCONFIG_CHECKER_PACKAGE ?= github.com/editorconfig-checker/editorconfig-checker/cmd/[email protected]
3030
GOFUMPT_PACKAGE ?= mvdan.cc/[email protected]
31-
GOLANGCI_LINT_PACKAGE ?= github.com/golangci/golangci-lint/cmd/golangci-lint@v1.55.2
31+
GOLANGCI_LINT_PACKAGE ?= github.com/golangci/golangci-lint/cmd/golangci-lint@v1.56.1
3232
GXZ_PACKAGE ?= github.com/ulikunitz/xz/cmd/[email protected]
3333
MISSPELL_PACKAGE ?= github.com/golangci/misspell/cmd/[email protected]
3434
SWAGGER_PACKAGE ?= github.com/go-swagger/go-swagger/cmd/[email protected]

models/issues/issue_xref.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,10 @@ func neuterCrossReferences(ctx context.Context, issueID, commentID int64) error
4646
for i, c := range active {
4747
ids[i] = c.ID
4848
}
49-
return neuterCrossReferencesIds(ctx, ids)
49+
return neuterCrossReferencesIDs(ctx, ids)
5050
}
5151

52-
func neuterCrossReferencesIds(ctx context.Context, ids []int64) error {
52+
func neuterCrossReferencesIDs(ctx context.Context, ids []int64) error {
5353
_, err := db.GetEngine(ctx).In("id", ids).Cols("`ref_action`").Update(&Comment{RefAction: references.XRefActionNeutered})
5454
return err
5555
}
@@ -100,7 +100,7 @@ func (issue *Issue) createCrossReferences(stdCtx context.Context, ctx *crossRefe
100100
}
101101
}
102102
if len(ids) > 0 {
103-
if err = neuterCrossReferencesIds(stdCtx, ids); err != nil {
103+
if err = neuterCrossReferencesIDs(stdCtx, ids); err != nil {
104104
return err
105105
}
106106
}

models/issues/review_list.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ type ReviewList []*Review
1818

1919
// LoadReviewers loads reviewers
2020
func (reviews ReviewList) LoadReviewers(ctx context.Context) error {
21-
reviewerIds := make([]int64, len(reviews))
21+
reviewerIDs := make([]int64, len(reviews))
2222
for i := 0; i < len(reviews); i++ {
23-
reviewerIds[i] = reviews[i].ReviewerID
23+
reviewerIDs[i] = reviews[i].ReviewerID
2424
}
25-
reviewers, err := user_model.GetPossibleUserByIDs(ctx, reviewerIds)
25+
reviewers, err := user_model.GetPossibleUserByIDs(ctx, reviewerIDs)
2626
if err != nil {
2727
return err
2828
}
@@ -38,12 +38,12 @@ func (reviews ReviewList) LoadReviewers(ctx context.Context) error {
3838
}
3939

4040
func (reviews ReviewList) LoadIssues(ctx context.Context) error {
41-
issueIds := container.Set[int64]{}
41+
issueIDs := container.Set[int64]{}
4242
for i := 0; i < len(reviews); i++ {
43-
issueIds.Add(reviews[i].IssueID)
43+
issueIDs.Add(reviews[i].IssueID)
4444
}
4545

46-
issues, err := GetIssuesByIDs(ctx, issueIds.Values())
46+
issues, err := GetIssuesByIDs(ctx, issueIDs.Values())
4747
if err != nil {
4848
return err
4949
}

modules/git/log_name_status.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -143,19 +143,19 @@ func (g *LogNameStatusRepoParser) Next(treepath string, paths2ids map[string]int
143143
}
144144

145145
// Our "line" must look like: <commitid> SP (<parent> SP) * NUL
146-
commitIds := string(g.next)
146+
commitIDs := string(g.next)
147147
if g.buffull {
148148
more, err := g.rd.ReadString('\x00')
149149
if err != nil {
150150
return nil, err
151151
}
152-
commitIds += more
152+
commitIDs += more
153153
}
154-
commitIds = commitIds[:len(commitIds)-1]
155-
splitIds := strings.Split(commitIds, " ")
156-
ret.CommitID = splitIds[0]
157-
if len(splitIds) > 1 {
158-
ret.ParentIDs = splitIds[1:]
154+
commitIDs = commitIDs[:len(commitIDs)-1]
155+
splitIDs := strings.Split(commitIDs, " ")
156+
ret.CommitID = splitIDs[0]
157+
if len(splitIDs) > 1 {
158+
ret.ParentIDs = splitIDs[1:]
159159
}
160160

161161
// now read the next "line"

modules/repository/generate.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ type GiteaTemplate struct {
9494
}
9595

9696
// Globs parses the .gitea/template globs or returns them if they were already parsed
97-
func (gt GiteaTemplate) Globs() []glob.Glob {
97+
func (gt *GiteaTemplate) Globs() []glob.Glob {
9898
if gt.globs != nil {
9999
return gt.globs
100100
}

routers/web/org/projects.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -377,16 +377,16 @@ func ViewProject(ctx *context.Context) {
377377
linkedPrsMap := make(map[int64][]*issues_model.Issue)
378378
for _, issuesList := range issuesMap {
379379
for _, issue := range issuesList {
380-
var referencedIds []int64
380+
var referencedIDs []int64
381381
for _, comment := range issue.Comments {
382382
if comment.RefIssueID != 0 && comment.RefIsPull {
383-
referencedIds = append(referencedIds, comment.RefIssueID)
383+
referencedIDs = append(referencedIDs, comment.RefIssueID)
384384
}
385385
}
386386

387-
if len(referencedIds) > 0 {
387+
if len(referencedIDs) > 0 {
388388
if linkedPrs, err := issues_model.Issues(ctx, &issues_model.IssuesOptions{
389-
IssueIDs: referencedIds,
389+
IssueIDs: referencedIDs,
390390
IsPull: util.OptionalBoolTrue,
391391
}); err == nil {
392392
linkedPrsMap[issue.ID] = linkedPrs

routers/web/repo/projects.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -339,16 +339,16 @@ func ViewProject(ctx *context.Context) {
339339
linkedPrsMap := make(map[int64][]*issues_model.Issue)
340340
for _, issuesList := range issuesMap {
341341
for _, issue := range issuesList {
342-
var referencedIds []int64
342+
var referencedIDs []int64
343343
for _, comment := range issue.Comments {
344344
if comment.RefIssueID != 0 && comment.RefIsPull {
345-
referencedIds = append(referencedIds, comment.RefIssueID)
345+
referencedIDs = append(referencedIDs, comment.RefIssueID)
346346
}
347347
}
348348

349-
if len(referencedIds) > 0 {
349+
if len(referencedIDs) > 0 {
350350
if linkedPrs, err := issues_model.Issues(ctx, &issues_model.IssuesOptions{
351-
IssueIDs: referencedIds,
351+
IssueIDs: referencedIDs,
352352
IsPull: util.OptionalBoolTrue,
353353
}); err == nil {
354354
linkedPrsMap[issue.ID] = linkedPrs

0 commit comments

Comments
 (0)