From 79c4237cb296b760f1142951d04b6e4bf3aa4e76 Mon Sep 17 00:00:00 2001 From: Giteabot Date: Thu, 8 Oct 2026 11:25:28 -0700 Subject: [PATCH] chore(deps): update go toolchain directive to v1.27.2 (#39685) (#39687) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Backport #39685 by @GiteaBot This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [go](https://go.dev/) ([source](https://redirect.github.com/golang/go)) | toolchain | patch | `1.27.1` → `1.27.2` | --- ### Configuration 📅 **Schedule**: (UTC) - Branch creation - At any time (no schedule defined) - Automerge - At any time (no schedule defined) 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate CLI](https://redirect.github.com/renovatebot/renovate). --- Makefile | 2 +- go.mod | 2 +- modules/assetfs/embed.go | 6 +++--- modules/web/routing/funcinfo.go | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index e286677d71d..77b9cc96825 100644 --- a/Makefile +++ b/Makefile @@ -6,7 +6,7 @@ SHASUM ?= shasum -a 256 AIR_PACKAGE ?= github.com/air-verse/air@v1.67.4 # renovate: datasource=go EDITORCONFIG_CHECKER_PACKAGE ?= github.com/editorconfig-checker/editorconfig-checker/v4/cmd/editorconfig-checker@v4.0.2 # renovate: datasource=go -GOLANGCI_LINT_PACKAGE ?= github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.13.2 # renovate: datasource=go +GOLANGCI_LINT_PACKAGE ?= github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.14.0 # renovate: datasource=go GXZ_PACKAGE ?= github.com/ulikunitz/xz/cmd/gxz@v0.5.17 # renovate: datasource=go MISSPELL_PACKAGE ?= github.com/golangci/misspell/cmd/misspell@v0.8.0 # renovate: datasource=go SWAGGER_PACKAGE ?= github.com/go-swagger/go-swagger/cmd/swagger@v0.36.6 # renovate: datasource=go diff --git a/go.mod b/go.mod index 9c474172478..b4b2ce6510d 100644 --- a/go.mod +++ b/go.mod @@ -2,7 +2,7 @@ module gitea.dev go 1.27 -toolchain go1.27.1 +toolchain go1.27.2 require ( connectrpc.com/connect v1.21.0 diff --git a/modules/assetfs/embed.go b/modules/assetfs/embed.go index 99a6e5e6242..28d0fc25f03 100644 --- a/modules/assetfs/embed.go +++ b/modules/assetfs/embed.go @@ -102,11 +102,11 @@ func NewEmbeddedFS(data []byte) fs.ReadDirFS { efs := &embeddedFS{data: data, files: make(map[string]*embeddedFileInfo)} efs.meta = sync.OnceValue(func() *EmbeddedMeta { var meta EmbeddedMeta - p := bytes.LastIndexByte(data, '\n') - if p < 0 { + _, metaJSON, ok := bytes.CutLast(data, []byte{'\n'}) + if !ok { return &meta } - if err := json.Unmarshal(data[p+1:], &meta); err != nil { + if err := json.Unmarshal(metaJSON, &meta); err != nil { panic("embedded file is not valid") } return &meta diff --git a/modules/web/routing/funcinfo.go b/modules/web/routing/funcinfo.go index 8a94711c323..7776c975b24 100644 --- a/modules/web/routing/funcinfo.go +++ b/modules/web/routing/funcinfo.go @@ -135,8 +135,8 @@ func shortenFilename(filename, fallback string) string { if filename == "" { return fallback } - if lastIndex := strings.LastIndexByte(filename, '/'); lastIndex >= 0 { - if secondLastIndex := strings.LastIndexByte(filename[:lastIndex], '/'); secondLastIndex >= 0 { + if dir, _, ok := strings.CutLast(filename, "/"); ok { + if secondLastIndex := strings.LastIndexByte(dir, '/'); secondLastIndex >= 0 { return filename[secondLastIndex+1:] } }