You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by wu...@apache.org on 2026/09/03 13:45:01 UTC

(skywalking-ai-sessionizer) branch main updated: Move to Go 1.27 and golangci-lint v2

This is an automated email from the ASF dual-hosted git repository.

wu-sheng pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/skywalking-ai-sessionizer.git


The following commit(s) were added to refs/heads/main by this push:
     new e9ae54f  Move to Go 1.27 and golangci-lint v2
e9ae54f is described below

commit e9ae54f352cda75271ccd0526d8a583f4e7aa649
Author: Wu Sheng <wu...@foxmail.com>
AuthorDate: Thu Sep 3 21:44:53 2026 +0800

    Move to Go 1.27 and golangci-lint v2
    
    Go 1.27.1 is the current stable release and 1.26 the previous line, so
    the module, the CI matrix, the image base and the docs move from 1.25
    to 1.27. The build, the five cross-compiles, the tests and the image on
    golang:1.27 were verified locally under the 1.27 toolchain.
    
    golangci-lint v1.64.8 cannot read Go 1.27 export data, so the linter
    moves to v2.13.2, installed from its v2 module path. Its own migrate
    command converted the configuration: the standard linters are on by
    default in v2, gofmt and goimports are formatters, and the v1 default
    exclusions are kept as presets so nothing that passed before fails now.
    The newer staticcheck asked for one tagged switch in discovery.
---
 .github/workflows/ci.yaml                |  6 ++---
 .golangci.yml                            | 40 ++++++++++++++++++++------------
 CLAUDE.md                                |  2 +-
 Dockerfile                               |  2 +-
 Makefile                                 |  4 ++--
 docs/en/guides/contributing.md           |  2 +-
 docs/en/setup/quick-start.md             |  2 +-
 go.mod                                   |  2 +-
 internal/adapters/claudecode/discover.go |  4 ++--
 9 files changed, 37 insertions(+), 27 deletions(-)

diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml
index 0acafee..716644d 100644
--- a/.github/workflows/ci.yaml
+++ b/.github/workflows/ci.yaml
@@ -69,7 +69,7 @@ jobs:
       - uses: actions/checkout@v4
       - uses: actions/setup-go@v5
         with:
-          go-version: '1.25'
+          go-version: '1.27'
           cache: true
       - name: Verify go.mod is tidy
         run: |
@@ -103,7 +103,7 @@ jobs:
           ref: ${{ github.event_name == 'workflow_dispatch' && inputs.tag || github.ref }}
       - uses: actions/setup-go@v5
         with:
-          go-version: '1.25'
+          go-version: '1.27'
           cache: true
       - name: Version
         id: v
@@ -146,7 +146,7 @@ jobs:
       - uses: actions/checkout@v4
       - uses: actions/setup-go@v5
         with:
-          go-version: '1.25'
+          go-version: '1.27'
           cache: true
       - name: Lint
         run: make lint
diff --git a/.golangci.yml b/.golangci.yml
index f1383fb..76916a1 100644
--- a/.golangci.yml
+++ b/.golangci.yml
@@ -15,22 +15,32 @@
 # specific language governing permissions and limitations
 # under the License.
 
-run:
-  timeout: 5m
+
+# golangci-lint v2 configuration. errcheck, govet, ineffassign, staticcheck and
+# unused are on by default in v2; the list below adds to them. gofmt and
+# goimports are formatters in v2, not linters. The exclusion presets keep the
+# v1 defaults this project was linted with.
+version: "2"
 linters:
   enable:
-    - errcheck
-    - govet
-    - ineffassign
-    - staticcheck
-    - unused
-    - gofmt
-    - goimports
-    - misspell
-    - revive
     - bodyclose
     - errorlint
-issues:
-  exclude-rules:
-    - path: _test\.go
-      linters: [errcheck]
+    - misspell
+    - revive
+  exclusions:
+    generated: lax
+    presets:
+      - comments
+      - common-false-positives
+      - legacy
+      - std-error-handling
+    rules:
+      - linters:
+          - errcheck
+        path: _test\.go
+formatters:
+  enable:
+    - gofmt
+    - goimports
+  exclusions:
+    generated: lax
diff --git a/CLAUDE.md b/CLAUDE.md
index c808e04..5cf56d5 100644
--- a/CLAUDE.md
+++ b/CLAUDE.md
@@ -98,7 +98,7 @@ make docker         # the container image, as CI builds and publishes it
 make help           # all targets
 ```
 
-Go 1.25+. One dependency: `gopkg.in/yaml.v3`.
+Go 1.27+. One dependency: `gopkg.in/yaml.v3`.
 
 Every source file carries the Apache-2.0 header; `make license-fix` inserts missing ones.
 `license-eye` is pinned to v0.9.0 — v0.7.0 does not build under Go 1.26.
diff --git a/Dockerfile b/Dockerfile
index f497556..966cebf 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -18,7 +18,7 @@
 # The binary is cross-compiled on the build host: Go builds every target
 # platform from one machine, so a multi-platform image needs no emulation
 # and no third-party build action.
-FROM --platform=$BUILDPLATFORM golang:1.25 AS build
+FROM --platform=$BUILDPLATFORM golang:1.27 AS build
 ARG TARGETOS
 ARG TARGETARCH
 # The version the binary reports. CI passes the release version or the
diff --git a/Makefile b/Makefile
index 03e9466..cc6125c 100644
--- a/Makefile
+++ b/Makefile
@@ -35,7 +35,7 @@ PLATFORMS := darwin/arm64 darwin/amd64 linux/amd64 linux/arm64 windows/amd64
 DIST      := dist
 PKG_BASE  := apache-skywalking-ai-sessionizer-$(VERSION)-bin
 
-GOLANGCI_LINT_VERSION := v1.64.8
+GOLANGCI_LINT_VERSION := v2.13.2
 LICENSE_EYE_VERSION   := v0.9.0
 
 .DEFAULT_GOAL := check
@@ -75,7 +75,7 @@ vet:
 
 $(BIN_DIR)/golangci-lint: $(BIN_DIR)
 	@echo "installing golangci-lint $(GOLANGCI_LINT_VERSION)"
-	@GOBIN=$(CURDIR)/$(BIN_DIR) $(GO) install github.com/golangci/golangci-lint/cmd/golangci-lint@$(GOLANGCI_LINT_VERSION)
+	@GOBIN=$(CURDIR)/$(BIN_DIR) $(GO) install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@$(GOLANGCI_LINT_VERSION)
 
 ## lint: run golangci-lint
 .PHONY: lint
diff --git a/docs/en/guides/contributing.md b/docs/en/guides/contributing.md
index 7af8ba6..8e015e6 100644
--- a/docs/en/guides/contributing.md
+++ b/docs/en/guides/contributing.md
@@ -7,7 +7,7 @@ pull requests against `main`.
 
 ## Build and test
 
-Go 1.25 or later. The module has one dependency, a YAML parser, and adding another needs a reason.
+Go 1.27 or later. The module has one dependency, a YAML parser, and adding another needs a reason.
 
 ```sh
 make build          # -> ./bin/asz
diff --git a/docs/en/setup/quick-start.md b/docs/en/setup/quick-start.md
index bbb6a25..a96ddba 100644
--- a/docs/en/setup/quick-start.md
+++ b/docs/en/setup/quick-start.md
@@ -28,7 +28,7 @@ Or build it yourself.
 
 ## Build
 
-Go 1.25 or later. The module has one dependency, a YAML parser.
+Go 1.27 or later. The module has one dependency, a YAML parser.
 
 ```sh
 git clone https://github.com/apache/skywalking-ai-sessionizer.git
diff --git a/go.mod b/go.mod
index a8d6389..39a7ab8 100644
--- a/go.mod
+++ b/go.mod
@@ -1,5 +1,5 @@
 module github.com/apache/skywalking-ai-sessionizer
 
-go 1.25
+go 1.27
 
 require gopkg.in/yaml.v3 v3.0.1
diff --git a/internal/adapters/claudecode/discover.go b/internal/adapters/claudecode/discover.go
index 8416fc0..1d89f65 100644
--- a/internal/adapters/claudecode/discover.go
+++ b/internal/adapters/claudecode/discover.go
@@ -321,8 +321,8 @@ func discoverWorkflowAgents(subDir, relSub, session string) []Source {
 			if it.IsDir() {
 				continue
 			}
-			switch {
-			case name == "journal.jsonl":
+			switch name {
+			case "journal.jsonl":
 				out = append(out, Source{
 					Kind: SrcJournal, Path: filepath.Join(runPath, name),
 					Rel: relPath(relRun, name), Session: session, RunID: runID,