diff --git a/.github/workflows/gochecks.yml b/.github/workflows/gochecks.yml new file mode 100644 index 0000000..30b7ee3 --- /dev/null +++ b/.github/workflows/gochecks.yml @@ -0,0 +1,26 @@ +name: go-checks + +on: + push: + branches: [main] + pull_request: + # The branches below must be a subset of the branches above + branches: [main] + +jobs: + check: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # pin@v3 + - name: Setup Go environment + uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # pin@v4 + with: + go-version: '1.20' + check-latest: true + - name: Run Vulncheck + run: | + go install golang.org/x/vuln/cmd/govulncheck@latest + govulncheck ./... + - name: Run golangci-lint + uses: golangci/golangci-lint-action@3a919529898de77ec3da873e3063ca4b10e7f5cc # pin@v3 diff --git a/.golangci.yml b/.golangci.yml index 86686d3..3847205 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,4 +1,4 @@ -# Config for golanglint-ci +# Config for golangci-lint # output configuration options @@ -45,14 +45,6 @@ linters-settings: - (github.com/golangci/golangci-lint/pkg/logutils.Log).FErrf enable-all: true disable-all: false - depguard: - list-type: blacklist - include-go-root: false - packages: - - github.com/sirupsen/logrus - packages-with-error-message: - # specify an error message to output when a blacklisted package is used - - github.com/sirupsen/logrus: "logging is allowed only by fortio.log" lll: # max line length, lines longer will be reported. Default is 120. # '\t' is counted as 1 character by default, and can be changed with the tab-width option @@ -115,6 +107,7 @@ linters: - cyclop - forcetypeassert - ireturn + - depguard enable-all: true disable-all: false # Must not use fast: true in newer golangci-lint or it'll just skip a bunch of linter instead of doing caching like before (!) diff --git a/README.md b/README.md index 8d00385..be9c66a 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ Distributed HA in memory store for Golang go run . -config-port 7999 ``` -Then go change the `peers` on https://localhost:7999 to see: +Then go change the `peers` on http://localhost:7999/?type=dynamic to see: ``` 20:26:10 I mstore.go:17> Peer set changed from to a,b,c,z 20:26:10 I mstore.go:23> Connecting to added Peer : "a" diff --git a/cb/cb_test.go b/cb/cb_test.go index c5b2b18..d4630c9 100644 --- a/cb/cb_test.go +++ b/cb/cb_test.go @@ -147,6 +147,7 @@ func TestProducerConsumerScenario(t *testing.T) { }) } } + func testProducerConsumerScenario(t *testing.T, buffer cb.Queue[int]) { var wg sync.WaitGroup wg.Add(11) // 10 producers + 1 consumer @@ -198,6 +199,7 @@ func BenchmarkCircularBufferBlocking(b *testing.B) { }) } } + func benchmarkCircularBufferBlocking(b *testing.B, c cb.Queue[int]) { var x int for i := 0; i < b.N; i++ {