From c5ef16993377632828891101547a4524633485a8 Mon Sep 17 00:00:00 2001 From: xBlaz3kx Date: Sun, 19 Apr 2026 19:16:49 +0200 Subject: [PATCH 1/4] chore: bump go version --- go.mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 5389922..76bd20c 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/ChargePi/ocpp-manager -go 1.22.1 +go 1.26 replace github.com/lorenzodonini/ocpp-go v0.18.0 => github.com/ChargePi/ocpp-go v0.21.0 From d7f9fc6ce4f4f561e874e358ce7cb08cf34b769b Mon Sep 17 00:00:00 2001 From: xBlaz3kx Date: Sun, 19 Apr 2026 19:17:11 +0200 Subject: [PATCH 2/4] chore: use new when instantiating new values --- ocpp_v16/configuration_test.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ocpp_v16/configuration_test.go b/ocpp_v16/configuration_test.go index 42601a5..00f2625 100644 --- a/ocpp_v16/configuration_test.go +++ b/ocpp_v16/configuration_test.go @@ -95,8 +95,7 @@ func (s *OcppConfigTest) TestSetVersion() { func (s *OcppConfigTest) TestUpdateKey() { // Ok case - newVal := "1234" - err := s.config.UpdateKey("HeartbeatInterval", &newVal) + err := s.config.UpdateKey("HeartbeatInterval", new("1234")) s.Assert().NoError(err) value, err := s.config.GetConfigurationValue("HeartbeatInterval") s.Require().NoError(err) From fe6fe7fd7a0d88dcc6d31135622c6f490cbc7779 Mon Sep 17 00:00:00 2001 From: xBlaz3kx Date: Mon, 25 Aug 2025 09:53:48 +0200 Subject: [PATCH 3/4] feat: added makefile, formatting and lint rules --- .golangci.yaml | 39 +++++++++++++++++++++++++++++++++++++++ Makefile | 13 +++++++++++++ 2 files changed, 52 insertions(+) create mode 100644 .golangci.yaml create mode 100644 Makefile diff --git a/.golangci.yaml b/.golangci.yaml new file mode 100644 index 0000000..5ba2d59 --- /dev/null +++ b/.golangci.yaml @@ -0,0 +1,39 @@ +version: "2" +linters: + default: all + enable: + - bodyclose + - copyloopvar + - decorder + - errcheck + - errname + - forbidigo + - goconst + - gocritic + - gosec + - govet + - ineffassign + - intrange + - misspell + - nestif + - predeclared + - staticcheck + - testifylint + - unparam + - unused + - wastedassign + - whitespace + - wrapcheck + exclusions: + generated: lax + paths: + - ./examples + +formatters: + settings: + goimports: + local-prefixes: + - github.com/ChargePi/ocpp-manager + enable: + - gofmt + - goimports diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..01ef7bd --- /dev/null +++ b/Makefile @@ -0,0 +1,13 @@ +.PHONY: gen format lint test + +test: + go test -v -race -covermode=atomic ./... -coverpkg=./... -short -coverprofile=unit_coverage.out + +gen: + mockery + +lint: + golangci-lint run + +format: + golangci-lint fmt \ No newline at end of file From c00e05ee1a0c1502f5162cad6d54f89120650879 Mon Sep 17 00:00:00 2001 From: xBlaz3kx Date: Sun, 19 Apr 2026 19:24:25 +0200 Subject: [PATCH 4/4] chore: update pipelines --- .github/workflows/lint.yaml | 2 +- .github/workflows/test.yaml | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 5096ab5..e297d7d 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -16,7 +16,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v6 - name: Go Lint uses: reviewdog/action-golangci-lint@v2 diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 94bd0c3..c63a3d8 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -27,12 +27,11 @@ jobs: - name: Setup Go uses: actions/setup-go@v5 with: - go-version: 1.23.0 + go-version: 1.26 - name: Install dependencies and run tests run: | - go mod download - go test -v -race -covermode=atomic ./... -coverpkg=./... -short -coverprofile=unit_coverage.out + make test - name: Archive code coverage results uses: actions/upload-artifact@v4