Skip to content

Commit

Permalink
Merge pull request #10 from actforgood/upgrades
Browse files Browse the repository at this point in the history
Upgraded linter, go version, dependencies
  • Loading branch information
bogcon authored Jun 22, 2023
2 parents 7a97a5d + fba8aef commit f5b54fc
Show file tree
Hide file tree
Showing 15 changed files with 192 additions and 373 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ jobs:
strategy:
fail-fast: false
matrix:
go-version: [1.18.x, 1.19.x]
go-version: [1.19.x, 1.20.x]
platform: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.platform }}

steps:
- name: Install Go
uses: actions/setup-go@v3
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}

Expand Down Expand Up @@ -51,11 +51,11 @@ jobs:
strategy:
fail-fast: false
matrix:
go-version: [1.18.x, 1.19.x]
go-version: [1.19.x, 1.20.x]

services:
redis6:
image: redis:6.2.7
image: redis:6.2.12
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
Expand All @@ -65,7 +65,7 @@ jobs:
- 6379:6379

redis7:
image: redis:7.0.5
image: redis:7.0.11
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
Expand All @@ -76,7 +76,7 @@ jobs:

steps:
- name: Set up ${{ matrix.go-version }}
uses: actions/setup-go@v3
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}

Expand All @@ -100,7 +100,7 @@ jobs:
XCACHE_REDIS7_ADDRS: 127.0.0.1:6380

- name: Upload coverage to coveralls.io
if: matrix.go-version == '1.19.x'
if: matrix.go-version == '1.20.x'
uses: shogo82148/actions-goveralls@v1
with:
path-to-profile: cover-integration.out
Expand Down
2 changes: 1 addition & 1 deletion .golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ linters:
- goconst
- gocritic
- godot
- lll
- misspell
- nlreturn
- noctx
- whitespace
- lll

issues:
exclude-use-default: false
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
LINTER_VERSION=v1.50.1
LINTER_VERSION=v1.53.3
LINTER=./bin/golangci-lint
ifeq ($(OS),Windows_NT)
LINTER=./bin/golangci-lint.exe
Expand Down Expand Up @@ -33,11 +33,11 @@ test-integration: ## Run integration tests (with race condition detection).

.PHONY: bench
bench: ## Run benchmarks.
go test -race -run=^# -benchmem -benchtime=5s -bench=.
go test -race -benchmem -benchtime=5s -bench=.

.PHONY: bench-integration
bench-integration: ## Run integration benchmarks.
go test -race -tags=integration -run=^# -benchmem -benchtime=5s -bench=.
go test -race -tags=integration -benchmem -benchtime=5s -bench=.

.PHONY: cover
cover: ## Run tests with coverage. Generates "cover.out" profile and its html representation.
Expand Down
10 changes: 5 additions & 5 deletions assert_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (

// assertEqual checks if 2 values are equal.
// Returns successful assertion status.
func assertEqual(t *testing.T, expected interface{}, actual interface{}) bool {
func assertEqual(t *testing.T, expected any, actual any) bool {
t.Helper()
if !reflect.DeepEqual(expected, actual) {
t.Errorf(
Expand All @@ -32,7 +32,7 @@ func assertEqual(t *testing.T, expected interface{}, actual interface{}) bool {

// assertNotNil checks if value passed is not nil.
// Returns successful assertion status.
func assertNotNil(t *testing.T, actual interface{}) bool {
func assertNotNil(t *testing.T, actual any) bool {
t.Helper()
if isNil(actual) {
t.Error("should not be nil")
Expand All @@ -45,7 +45,7 @@ func assertNotNil(t *testing.T, actual interface{}) bool {

// assertNil checks if value passed is nil.
// Returns successful assertion status.
func assertNil(t *testing.T, actual interface{}) bool {
func assertNil(t *testing.T, actual any) bool {
t.Helper()
if !isNil(actual) {
t.Errorf("expected nil, but got %+v", actual)
Expand All @@ -57,7 +57,7 @@ func assertNil(t *testing.T, actual interface{}) bool {
}

// requireNil fails the test immediately if passed value is not nil.
func requireNil(t *testing.T, actual interface{}) {
func requireNil(t *testing.T, actual any) {
t.Helper()
if !isNil(actual) {
t.Errorf("expected nil, but got %+v", actual)
Expand All @@ -79,7 +79,7 @@ func assertTrue(t *testing.T, actual bool) bool {
}

// isNil checks an interface if it is nil.
func isNil(object interface{}) bool {
func isNil(object any) bool {
if object == nil {
return true
}
Expand Down
2 changes: 1 addition & 1 deletion build/Dockerfile.benchmark.local
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.19.3-alpine3.16
FROM golang:1.20.5-alpine3.18

LABEL maintainer="Bogdan Constantinescu"
LABEL description="Benchmark Runner for XCache"
Expand Down
2 changes: 1 addition & 1 deletion build/Dockerfile.test.local
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.19.3-alpine3.16
FROM golang:1.20.5-alpine3.18

LABEL maintainer="Bogdan Constantinescu"
LABEL description="Test Runner for XCache"
Expand Down
57 changes: 29 additions & 28 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,43 +1,44 @@
module github.com/actforgood/xcache

go 1.18
go 1.19

require (
github.com/actforgood/xconf v1.6.0
github.com/actforgood/xerr v1.1.0
github.com/actforgood/xlog v1.3.1
github.com/actforgood/xconf v1.7.0
github.com/actforgood/xerr v1.2.0
github.com/actforgood/xlog v1.4.0
github.com/coocood/freecache v1.2.3
github.com/go-redis/redis/v8 v8.11.5
github.com/go-redis/redis/v9 v9.0.0-rc.1
github.com/go-redis/redis/v9 v9.0.0-rc.2
)

require (
github.com/cespare/xxhash/v2 v2.1.2 // indirect
github.com/coreos/go-semver v0.3.0 // indirect
github.com/coreos/go-systemd/v22 v22.4.0 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/coreos/go-semver v0.3.1 // indirect
github.com/coreos/go-systemd/v22 v22.5.0 // indirect
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
github.com/fsnotify/fsnotify v1.5.4 // indirect
github.com/getsentry/sentry-go v0.14.0 // indirect
github.com/go-logfmt/logfmt v0.5.1 // indirect
github.com/getsentry/sentry-go v0.22.0 // indirect
github.com/go-logfmt/logfmt v0.6.0 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/joho/godotenv v1.4.0 // indirect
github.com/magiconair/properties v1.8.6 // indirect
github.com/pelletier/go-toml/v2 v2.0.5 // indirect
github.com/rogpeppe/go-internal v1.8.0 // indirect
github.com/spf13/cast v1.5.0 // indirect
go.etcd.io/etcd/api/v3 v3.5.5 // indirect
go.etcd.io/etcd/client/pkg/v3 v3.5.5 // indirect
go.etcd.io/etcd/client/v3 v3.5.5 // indirect
go.uber.org/atomic v1.10.0 // indirect
go.uber.org/multierr v1.8.0 // indirect
go.uber.org/zap v1.23.0 // indirect
golang.org/x/net v0.1.0 // indirect
golang.org/x/sys v0.1.0 // indirect
golang.org/x/text v0.4.0 // indirect
google.golang.org/genproto v0.0.0-20221027153422-115e99e71e1c // indirect
google.golang.org/grpc v1.50.1 // indirect
google.golang.org/protobuf v1.28.1 // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/joho/godotenv v1.5.1 // indirect
github.com/magiconair/properties v1.8.7 // indirect
github.com/pelletier/go-toml/v2 v2.0.8 // indirect
github.com/spf13/cast v1.5.1 // indirect
go.etcd.io/etcd/api/v3 v3.5.9 // indirect
go.etcd.io/etcd/client/pkg/v3 v3.5.9 // indirect
go.etcd.io/etcd/client/v3 v3.5.9 // indirect
go.uber.org/atomic v1.11.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/zap v1.24.0 // indirect
golang.org/x/net v0.11.0 // indirect
golang.org/x/sys v0.9.0 // indirect
golang.org/x/text v0.10.0 // indirect
google.golang.org/genproto v0.0.0-20230530153820-e85fd2cbaebc // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20230530153820-e85fd2cbaebc // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20230530153820-e85fd2cbaebc // indirect
google.golang.org/grpc v1.56.1 // indirect
google.golang.org/protobuf v1.30.0 // indirect
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
Expand Down
Loading

0 comments on commit f5b54fc

Please sign in to comment.