Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Go 1.23 #88

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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 .env.tools
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export TOOLS_BUILDNUMBER=20240805.1
export TOOLS_BUILDNUMBER=20240829.1
4 changes: 2 additions & 2 deletions .github/workflows/push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: '1.22'
go-version: '1.23'
cache: false
- name: Check formatting
uses: Jerome1337/gofmt-action@v1.0.5
Expand All @@ -30,7 +30,7 @@ jobs:
# Require: The version of golangci-lint to use.
# When `install-mode` is `binary` (default) the value can be v1.2 or v1.2.3 or `latest` to use the latest version.
# When `install-mode` is `goinstall` the value can be v1.2.3, `latest`, or the hash of a commit.
version: v1.56
version: v1.60
- name: Install Task
uses: arduino/setup-task@v1
with:
Expand Down
60 changes: 35 additions & 25 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,26 @@ linters-settings:
# Default: false
explicit-exhaustive-map: false
gci:
local-prefixes: jitsuin.com/avid
# Section configuration to compare against.
# Section names are case-insensitive and may contain parameters in ().
# The default order of sections is `standard > default > custom > blank > dot > alias > localmodule`,
# If `custom-order` is `true`, it follows the order of `sections` option.
# Default: ["standard", "default"]
sections:
- standard # Standard section: captures all standard packages.
- default # Default section: contains all imports that could not be matched to another section type.
- prefix(github.com/datatrails/avid) # Custom section: groups all imports with the specified Prefix.
- blank # Blank section: contains all blank imports. This section is not present unless explicitly enabled.
- dot # Dot section: contains all dot imports. This section is not present unless explicitly enabled.
- alias # Alias section: contains all alias imports. This section is not present unless explicitly enabled.
- localmodule # Local module section: contains all local packages. This section is not present unless explicitly enabled.
# Skip generated files.
# Default: true
skip-generated: false
# Enable custom order of sections.
# If `true`, make the section order the same as the order of `sections`.
# Default: false
custom-order: true
goconst:
min-len: 2
min-occurrences: 2
Expand All @@ -72,16 +91,13 @@ linters-settings:
min-complexity: 10
goimports:
local-prefixes: github.com/golangci/golangci-lint
golint:
min-confidence: 0
govet:
check-shadowing: true
settings:
printf:
funcs:
- Infof
- Warnf
- Errorf
- Debugf
- Panicf
- Fatalf
lll:
line-length: 500
Expand All @@ -108,7 +124,7 @@ linters-settings:
# paths anyway (we have no control over there layout). Until we get
# direct evidence this is hurting us, we prefer our stucts layed out
# logically and don't want to have to nolint tag everything.
#
#
# misspell - expected UK spelling with misspell, but customer facing text needs to be US.
# tagalign - suppress until we can get a golang code formatter that will fix this (cosmetic)
#
Expand All @@ -118,18 +134,20 @@ linters-settings:
linters:
enable-all: true
disable:
- canonicalheader
- containedctx
- contextcheck
- cyclop
- deadcode
- depguard
- dupl
- dupword
- durationcheck
- err113
- errchkjson
- errname
- exhaustivestruct
- execinquery
- exhaustruct
- exportloopref
- forbidigo
- forcetypeassert
# DONT re-enable funlen please
Expand All @@ -141,21 +159,17 @@ linters:
- gocyclo
- godot
- godox
- goerr113
- gofumpt
- golint
- gomoddirectives
- gomnd
- gosec
- gosimple
- ifshort
- inamedparam
- interfacer
- interfacebloat
- ireturn
- maligned
- maintidx
- misspell
- mnd
- musttag
- nilerr
- nilnil
Expand All @@ -164,16 +178,13 @@ linters:
- nestif
- nolintlint
- nonamedreturns
- nosnakecase
- nosprintfhostport
- paralleltest
- perfsprint
- protogetter
- prealloc
- protogetter
- revive
- rowserrcheck
- scopelint
- structcheck
- stylecheck
- tagalign
- tagliatelle
Expand All @@ -185,24 +196,23 @@ linters:
- unparam
- unused
- usestdlibvars
- varcheck
- varnamelen
- wastedassign
- whitespace
- wsl
- wrapcheck

run:
skip-dirs:
- api
- azb2c
skip-files:
- service/b2cpoliciesv1/b2cpolicies.go
- service/tenanciesv1/users_store.go
build-tags:
- golangcilint

issues:
exclude-dirs:
- api
- azb2c
exclude-files:
- service/b2cpoliciesv1/b2cpolicies.go
- service/tenanciesv1/users_store.go
exclude-rules:
- text: "weak cryptographic primitive"
linters:
Expand Down
9 changes: 6 additions & 3 deletions azblob/storer.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ import (
"github.com/datatrails/go-datatrails-common/logger"
)

var (
ErrUnspecifiedContainer = errors.New("storer: container is unspecified")
)

// so we dont have to import azure blob package anywhere else
type ContainerClient = azStorageBlob.ContainerClient
type ServiceClient = azStorageBlob.ServiceClient
Expand Down Expand Up @@ -58,9 +62,8 @@ func New(
rootURL := secret.URL

if container == "" {
msg := "storer: container is unspecified"
logger.Sugar.Infof(msg)
return nil, errors.New(msg)
logger.Sugar.Infof("Storer: %v", ErrUnspecifiedContainer)
return nil, ErrUnspecifiedContainer
}
azp := &Storer{
AccountName: accountName,
Expand Down
28 changes: 16 additions & 12 deletions azbus/receiver.go
Original file line number Diff line number Diff line change
Expand Up @@ -240,20 +240,24 @@ func (r *Receiver) receiveMessages(ctx context.Context) error {
select {
case <-rctx.Done():
rr.log.Debugf("Stop worker %d", ii)
wg.Done()
return
case msg := <-msgs:
var renewCtx context.Context
var renewCancel context.CancelFunc
var maxDuration time.Duration
if rr.Cfg.RenewMessageLock {
renewCtx, renewCancel = context.WithCancel(rctx)
go rr.renewMessageLock(renewCtx, ii+1, msg)
} else {
// we need a timeout if RenewMessageLock is disabled
renewCtx, renewCancel, maxDuration = rr.setTimeout(rctx, rr.log, msg)
}
rr.processMessage(renewCtx, ii+1, maxDuration, msg, rr.handlers[ii])
renewCancel()
func(rrctx context.Context) {
var renewCtx context.Context
var renewCancel context.CancelFunc
var maxDuration time.Duration
if rr.Cfg.RenewMessageLock {
renewCtx, renewCancel = context.WithCancel(rrctx)
go rr.renewMessageLock(renewCtx, ii+1, msg)
defer renewCancel()
} else {
// we need a timeout if RenewMessageLock is disabled
renewCtx, renewCancel, maxDuration = rr.setTimeout(rrctx, rr.log, msg)
defer renewCancel()
}
rr.processMessage(renewCtx, ii+1, maxDuration, msg, rr.handlers[ii])
}(rctx)
wg.Done()
}
}
Expand Down
68 changes: 34 additions & 34 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,18 @@ go 1.22

require (
github.com/Azure/azure-sdk-for-go v68.0.0+incompatible
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.11.1
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.12.0
github.com/Azure/azure-sdk-for-go/sdk/messaging/azservicebus v1.7.1
github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v0.4.1
github.com/Azure/go-autorest/autorest v0.11.29
github.com/Azure/go-autorest/autorest/azure/auth v0.5.12
github.com/Azure/go-autorest/autorest/azure/auth v0.5.13
github.com/KimMachineGun/automemlimit v0.6.1
github.com/alicebob/miniredis/v2 v2.32.1
github.com/fxamacker/cbor/v2 v2.5.0
github.com/fxamacker/cbor/v2 v2.7.0
github.com/go-redis/redis/v8 v8.11.5
github.com/google/uuid v1.6.0
github.com/gorilla/securecookie v1.1.1
github.com/gorilla/sessions v1.2.1
github.com/gorilla/securecookie v1.1.2
github.com/gorilla/sessions v1.3.0
github.com/grpc-ecosystem/go-grpc-middleware v1.4.0
github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0
github.com/ldclabs/cose/go v0.0.0-20221214142927-d22c1cfc2154
Expand All @@ -24,73 +24,73 @@ require (
github.com/opentracing-contrib/go-stdlib v1.0.0
github.com/opentracing/opentracing-go v1.2.0
github.com/openzipkin-contrib/zipkin-go-opentracing v0.5.0
github.com/openzipkin/zipkin-go v0.4.2
github.com/prometheus/client_golang v1.11.1
github.com/openzipkin/zipkin-go v0.4.3
github.com/prometheus/client_golang v1.19.1
github.com/stretchr/testify v1.9.0
github.com/veraison/go-cose v1.1.0
go.uber.org/automaxprocs v1.5.3
go.uber.org/zap v1.25.0
go.uber.org/zap v1.27.0
golang.org/x/sync v0.7.0
google.golang.org/genproto/googleapis/rpc v0.0.0-20240513163218-0867130af1f8
google.golang.org/grpc v1.64.1
google.golang.org/genproto/googleapis/rpc v0.0.0-20240701130421-f6361c86f094
google.golang.org/grpc v1.65.0
)

require (
github.com/Azure/go-amqp v1.0.5 // indirect
github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect
github.com/goccy/go-json v0.10.2 // indirect
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
github.com/goccy/go-json v0.10.3 // indirect
github.com/lestrrat-go/backoff/v2 v2.0.8 // indirect
github.com/lestrrat-go/blackmagic v1.0.2 // indirect
github.com/lestrrat-go/httpcc v1.0.1 // indirect
github.com/lestrrat-go/iter v1.0.2 // indirect
github.com/lestrrat-go/option v1.0.1 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect
github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/prometheus/client_model v0.2.0 // indirect
github.com/prometheus/common v0.26.0 // indirect
github.com/prometheus/procfs v0.6.0 // indirect
github.com/prometheus/client_model v0.5.0 // indirect
github.com/prometheus/common v0.48.0 // indirect
github.com/prometheus/procfs v0.12.0 // indirect
github.com/shengdoushi/base58 v1.0.0 // indirect
github.com/x448/float16 v0.8.4 // indirect
github.com/yuin/gopher-lua v1.1.1 // indirect
golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842 // indirect
)

require (
github.com/Azure/azure-sdk-for-go/sdk/internal v1.7.0 // indirect
github.com/Azure/azure-sdk-for-go/sdk/internal v1.9.1 // indirect
github.com/Azure/go-autorest v14.2.0+incompatible // indirect
github.com/Azure/go-autorest/autorest/adal v0.9.22 // indirect
github.com/Azure/go-autorest/autorest/azure/cli v0.4.5 // indirect
github.com/Azure/go-autorest/autorest/adal v0.9.24 // indirect
github.com/Azure/go-autorest/autorest/azure/cli v0.4.6 // indirect
github.com/Azure/go-autorest/autorest/date v0.3.0 // indirect
github.com/Azure/go-autorest/autorest/to v0.4.0 // indirect
github.com/Azure/go-autorest/autorest/validation v0.3.1 // indirect
github.com/Azure/go-autorest/logger v0.2.1 // indirect
github.com/Azure/go-autorest/tracing v0.6.0 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/cilium/ebpf v0.9.1 // indirect
github.com/containerd/cgroups/v3 v3.0.1 // indirect
github.com/coreos/go-systemd/v22 v22.3.2 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/cilium/ebpf v0.15.0 // indirect
github.com/containerd/cgroups/v3 v3.0.3 // indirect
github.com/coreos/go-systemd/v22 v22.5.0 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
github.com/dimchansky/utfbom v1.1.1 // indirect
github.com/docker/go-units v0.4.0 // indirect
github.com/gabriel-vasile/mimetype v1.4.2
github.com/godbus/dbus/v5 v5.0.4 // indirect
github.com/docker/go-units v0.5.0 // indirect
github.com/gabriel-vasile/mimetype v1.4.4
github.com/godbus/dbus/v5 v5.1.0 // indirect
github.com/golang-jwt/jwt/v4 v4.5.0 // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/mitchellh/go-homedir v1.1.0 // indirect
github.com/opencontainers/runtime-spec v1.0.2 // indirect
github.com/opencontainers/runtime-spec v1.2.0 // indirect
github.com/opentracing-contrib/go-observer v0.0.0-20170622124052-a52f23424492 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/sirupsen/logrus v1.8.1 // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/sirupsen/logrus v1.9.3 // indirect
github.com/stretchr/objx v0.5.2 // indirect
go.uber.org/multierr v1.10.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
golang.org/x/crypto v0.25.0 // indirect
golang.org/x/net v0.27.0 // indirect
golang.org/x/sys v0.22.0 // indirect
golang.org/x/text v0.16.0 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20240513163218-0867130af1f8 // indirect
google.golang.org/protobuf v1.34.1 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20240701130421-f6361c86f094 // indirect
google.golang.org/protobuf v1.34.2 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
Loading
Loading