From d88b01252519ef3215243df4d1c0c365e41628c9 Mon Sep 17 00:00:00 2001
From: techknowlogick <techknowlogick@gitea.com>
Date: Thu, 13 Feb 2025 05:00:00 -0500
Subject: [PATCH] go1.24 (#33562)

update to use go1.24

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
---
 Dockerfile          | 2 +-
 Dockerfile.rootless | 2 +-
 Makefile            | 2 +-
 flake.lock          | 6 +++---
 flake.nix           | 6 +++---
 go.mod              | 2 +-
 snap/snapcraft.yaml | 2 +-
 7 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/Dockerfile b/Dockerfile
index b95ba83289..fa2ae9913c 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,5 +1,5 @@
 # Build stage
-FROM docker.io/library/golang:1.23-alpine3.21 AS build-env
+FROM docker.io/library/golang:1.24-alpine3.21 AS build-env
 
 ARG GOPROXY
 ENV GOPROXY=${GOPROXY:-direct}
diff --git a/Dockerfile.rootless b/Dockerfile.rootless
index be6f125104..b74dfa58e0 100644
--- a/Dockerfile.rootless
+++ b/Dockerfile.rootless
@@ -1,5 +1,5 @@
 # Build stage
-FROM docker.io/library/golang:1.23-alpine3.21 AS build-env
+FROM docker.io/library/golang:1.24-alpine3.21 AS build-env
 
 ARG GOPROXY
 ENV GOPROXY=${GOPROXY:-direct}
diff --git a/Makefile b/Makefile
index d87d3a0946..67a4e27efc 100644
--- a/Makefile
+++ b/Makefile
@@ -23,7 +23,7 @@ SHASUM ?= shasum -a 256
 HAS_GO := $(shell hash $(GO) > /dev/null 2>&1 && echo yes)
 COMMA := ,
 
-XGO_VERSION := go-1.23.x
+XGO_VERSION := go-1.24.x
 
 AIR_PACKAGE ?= github.com/air-verse/air@v1
 EDITORCONFIG_CHECKER_PACKAGE ?= github.com/editorconfig-checker/editorconfig-checker/v3/cmd/editorconfig-checker@v3.1.2
diff --git a/flake.lock b/flake.lock
index 4319737c26..2f7b86359b 100644
--- a/flake.lock
+++ b/flake.lock
@@ -20,11 +20,11 @@
     },
     "nixpkgs": {
       "locked": {
-        "lastModified": 1736798957,
-        "narHash": "sha256-qwpCtZhSsSNQtK4xYGzMiyEDhkNzOCz/Vfu4oL2ETsQ=",
+        "lastModified": 1739214665,
+        "narHash": "sha256-26L8VAu3/1YRxS8MHgBOyOM8xALdo6N0I04PgorE7UM=",
         "owner": "nixos",
         "repo": "nixpkgs",
-        "rev": "9abb87b552b7f55ac8916b6fc9e5cb486656a2f3",
+        "rev": "64e75cd44acf21c7933d61d7721e812eac1b5a0a",
         "type": "github"
       },
       "original": {
diff --git a/flake.nix b/flake.nix
index f54eba1c3b..1b930649d0 100644
--- a/flake.nix
+++ b/flake.nix
@@ -29,13 +29,13 @@
             poetry
 
             # backend
-            go_1_23
+            go_1_24
             gofumpt
             sqlite
           ];
           shellHook = ''
-            export GO="${pkgs.go_1_23}/bin/go"
-            export GOROOT="${pkgs.go_1_23}/share/go"
+            export GO="${pkgs.go_1_24}/bin/go"
+            export GOROOT="${pkgs.go_1_24}/share/go"
           '';
         };
       }
diff --git a/go.mod b/go.mod
index e2ccdd5ae6..593e69acd3 100644
--- a/go.mod
+++ b/go.mod
@@ -1,6 +1,6 @@
 module code.gitea.io/gitea
 
-go 1.23
+go 1.24
 
 // rfc5280 said: "The serial number is an integer assigned by the CA to each certificate."
 // But some CAs use negative serial number, just relax the check. related:
diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml
index c4c31968e0..596f703131 100644
--- a/snap/snapcraft.yaml
+++ b/snap/snapcraft.yaml
@@ -44,7 +44,7 @@ parts:
     source: .
     stage-packages: [ git, sqlite3, openssh-client ]
     build-packages: [ git, libpam0g-dev, libsqlite3-dev, build-essential]
-    build-snaps: [ go/1.23/stable, node/22/stable ]
+    build-snaps: [ go/1.24/stable, node/22/stable ]
     build-environment:
       - LDFLAGS: ""
     override-pull: |