Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
39 changes: 39 additions & 0 deletions .golangci.yaml
Original file line number Diff line number Diff line change
@@ -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
13 changes: 13 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -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

Expand Down
3 changes: 1 addition & 2 deletions ocpp_v16/configuration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Loading