Skip to content

Commit

Permalink
upgrade to go 1.22
Browse files Browse the repository at this point in the history
Signed-off-by: Jack Ding <[email protected]>
  • Loading branch information
jzding committed Jun 14, 2024
1 parent 11968a1 commit e3d34a4
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 21 deletions.
19 changes: 8 additions & 11 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,30 +6,27 @@ jobs:
name: Linting
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v2
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.21'
go-version: '1.22'
- name: tidy
run: go mod tidy
- name: golangci-lint
uses: golangci/golangci-lint-action@v4
uses: golangci/golangci-lint-action@v6
with:
# Caching conflicts happen in GHA, so just disable for now
skip-pkg-cache: true
skip-build-cache: true
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
version: v1.54
version: v1.59
args: --timeout 3m0s
unit-tests:
name: Unit Tests
runs-on: ubuntu-20.04
steps:
- name: Checkout code
uses: actions/checkout@v3
- uses: actions/setup-go@v2
uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.21'
go-version: '1.22'
- name: tidy
run: go mod tidy
- name: Run Test Scripts
Expand Down
19 changes: 11 additions & 8 deletions .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,9 @@ run:
deadline: 3m
issues-exit-code: 1
tests: true
skip-dirs:
- vendor
- .go
- pkg/util/wait

output:
format: colored-line-number
formats: colored-line-number
print-issued-lines: true
print-linter-name: true

Expand All @@ -18,7 +14,8 @@ linters-settings:
# minimal code complexity to report, 30 by default (but we recommend 10-20)
min-complexity: 30
govet:
check-shadowing: true
enable:
- shadow
goconst:
min-len: 3
min-occurrences: 4
Expand All @@ -32,13 +29,12 @@ linters:
- goconst
- gocyclo
- goimports
- revive
- gosec
- gosimple
- govet
- ineffassign
- megacheck
- misspell
- revive
- typecheck
- unconvert
- unparam
Expand All @@ -47,6 +43,13 @@ linters:
fast: false

issues:
exclude-dirs:
- vendor
- .go
- pkg/util/wait
exclude-dirs-use-default: false
exclude-files:
exclude-use-default: false
# Excluding configuration per-path, per-linter, per-text and per-source
exclude-rules:
- linters:
Expand Down
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/redhat-cne/sdk-go

go 1.21
go 1.22

require (
github.com/cloudevents/sdk-go/v2 v2.15.2
Expand Down
3 changes: 2 additions & 1 deletion pkg/protocol/http/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,8 @@ func (h *Server) HTTPProcessor(wg *sync.WaitGroup) {
wg.Add(1)
go func(h *Server, wg *sync.WaitGroup) {
defer wg.Done()
for { //nolint:gosimple Producer: Sender Object--->Event Default Listener:Consumer
// Producer: Sender Object--->Event Default Listener:Consumer
for { //nolint:gosimple
select {
case d := <-h.DataIn: //skips publisher object processing
if d.Type == channel.SUBSCRIBER && (d.Status == channel.NEW || d.Status == channel.DELETE) { // Listener means subscriber aka sender
Expand Down

0 comments on commit e3d34a4

Please sign in to comment.