Skip to content

Commit

Permalink
redirect take into account base path rewritten on nginx, new linter (#58
Browse files Browse the repository at this point in the history
)
  • Loading branch information
ice-cronus authored Aug 30, 2024
1 parent bdaacde commit 972a3e4
Show file tree
Hide file tree
Showing 12 changed files with 152 additions and 150 deletions.
6 changes: 3 additions & 3 deletions connectors/message_broker/message_broker.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ func (mb *messageBroker) connect(additionalOpts ...kgo.Opt) error { //nolint:fun
if mb.cfg.MessageBroker.MaxMessageBytes == 0 {
mb.cfg.MessageBroker.MaxMessageBytes = 10485760
}
opts = append(opts, kgo.ProducerBatchMaxBytes(int32(mb.cfg.MessageBroker.MaxMessageBytes)))
opts = append(opts, kgo.ProducerBatchMaxBytes(int32(mb.cfg.MessageBroker.MaxMessageBytes))) //nolint:gosec // .
log.Info("connecting to MessageBroker...", "URLs", mb.cfg.MessageBroker.URLs)
var err error
mb.client, err = kgo.NewClient(opts...)
Expand Down Expand Up @@ -196,7 +196,7 @@ func (mb *messageBroker) createTopic(ctx context.Context, tpc *TopicConfig) {
"segment.ms": kadm.StringPtr(strconv.Itoa(int(tpc.Retention.Milliseconds()))),
}
log.Info("trying to create topic", "topic", tpc)
createTopicsResponse, cErr := mb.admClient.CreateTopics(ctx, int32(tpc.Partitions), int16(tpc.ReplicationFactor), configs, tpc.Name)
createTopicsResponse, cErr := mb.admClient.CreateTopics(ctx, int32(tpc.Partitions), int16(tpc.ReplicationFactor), configs, tpc.Name) //nolint:gosec // .
if cErr != nil {
log.Panic(errors.Wrap(cErr, "could not create topic"), "topic", tpc)
}
Expand Down Expand Up @@ -228,7 +228,7 @@ func (mb *messageBroker) validateTopicListing(ctx context.Context, topics []stri
log.Info(fmt.Sprintf("topics %v found! ", topics), "topics", sortedTopicDetails)
if mb.concurrentConsumer != nil && mb.partitionCountPerTopic != nil {
for i := range sortedTopicDetails {
mb.partitionCountPerTopic.Store(sortedTopicDetails[i].Topic, int32(len(sortedTopicDetails[i].Partitions)))
mb.partitionCountPerTopic.Store(sortedTopicDetails[i].Topic, int32(len(sortedTopicDetails[i].Partitions))) //nolint:gosec // .
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion connectors/storage/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ func CheckSQLDMLResponse(resp *tarantool.Response, err error) (affectedRows int6
if !okUnsigned {
return 0, errors.Errorf("unexpected SQL DML response: %[1]v %[1]T", resp.Data[0])
}
count = int64(unsignedCount)
count = int64(unsignedCount) //nolint:gosec // .
}

return count, nil
Expand Down
2 changes: 1 addition & 1 deletion connectors/storage/v2/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ func IsErr(err, target error, column ...string) bool {
return false
}
if tErr := terror.As(err); tErr != nil {
if len(column) == 1 && column[0] != "" { //nolint:revive // Wrong.
if len(column) == 1 && column[0] != "" {
if val, found := tErr.Data["column"]; found {
return val == column[0]
}
Expand Down
4 changes: 2 additions & 2 deletions connectors/storage/v2/lock.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
)

func NewMutex(db *DB, lockID string) Mutex {
lockIDHash := int64(xxh3.HashString(lockID))
lockIDHash := int64(xxh3.HashString(lockID)) //nolint:gosec // .
l := &advisoryLockMutex{conn: nil, db: db, id: lockIDHash}

return l
Expand Down Expand Up @@ -77,7 +77,7 @@ func (l *advisoryLockMutex) EnsureLocked(ctx context.Context) error {
func (l *advisoryLockMutex) checkIfAnotherRuntimeHandlesLock(ctx context.Context) error {
_, err := execOne[struct {
PID int32 `db:"pid"`
}](ctx, l.db.primary(), "SELECT pid FROM pg_locks WHERE objid = $1 and granted = true", int32(l.id))
}](ctx, l.db.primary(), "SELECT pid FROM pg_locks WHERE objid = $1 and granted = true", int32(l.id)) //nolint:gosec // .

return err
}
2 changes: 1 addition & 1 deletion email/fixture/fixture.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ func getMailbox(ctx context.Context, tb testing.TB, login, server string) []uint
ID uint64 `json:"id"`
}
url := fmt.Sprintf("https://www.1secmail.com/api/v1/?action=getMessages&login=%v&domain=%v", login, server)
for ctx.Err() == nil && len(messageListData) == 0 {
for len(messageListData) == 0 && ctx.Err() == nil {
messageListBody, messageListStatus := do1SecMailRequest(ctx, tb, url)
assert.Equal(tb, 200, messageListStatus) //nolint:mnd,gomnd // Not a magic.
require.NoError(tb, json.UnmarshalContext(ctx, messageListBody, &messageListData))
Expand Down
88 changes: 44 additions & 44 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
module github.com/ice-blockchain/wintr

go 1.22
go 1.23

require (
cosmossdk.io/math v1.3.0
dario.cat/mergo v1.0.0
dario.cat/mergo v1.0.1
firebase.google.com/go/v4 v4.14.1
github.com/GetStream/stream-go2/v7 v7.1.0
github.com/cenkalti/backoff/v4 v4.3.0
Expand All @@ -25,41 +25,41 @@ require (
github.com/redis/go-redis/v9 v9.6.1
github.com/rs/zerolog v1.33.0
github.com/sendgrid/rest v2.6.9+incompatible
github.com/sendgrid/sendgrid-go v3.14.0+incompatible
github.com/sendgrid/sendgrid-go v3.16.0+incompatible
github.com/spf13/viper v1.19.0
github.com/stretchr/testify v1.9.0
github.com/swaggo/files v1.0.1
github.com/swaggo/gin-swagger v1.6.0
github.com/testcontainers/testcontainers-go v0.32.0
github.com/twilio/twilio-go v1.22.3
github.com/twmb/franz-go v1.17.0
github.com/twmb/franz-go/pkg/kadm v1.12.0
github.com/twilio/twilio-go v1.22.4
github.com/twmb/franz-go v1.17.1
github.com/twmb/franz-go/pkg/kadm v1.13.0
github.com/vmihailenco/msgpack/v5 v5.4.1
github.com/xlzd/gotp v0.1.0
github.com/zeebo/xxh3 v1.0.2
golang.org/x/net v0.27.0
google.golang.org/api v0.189.0
golang.org/x/net v0.28.0
google.golang.org/api v0.195.0
)

require (
cloud.google.com/go v0.115.0 // indirect
cloud.google.com/go/auth v0.7.2 // indirect
cloud.google.com/go/auth/oauth2adapt v0.2.3 // indirect
cloud.google.com/go v0.115.1 // indirect
cloud.google.com/go/auth v0.9.1 // indirect
cloud.google.com/go/auth/oauth2adapt v0.2.4 // indirect
cloud.google.com/go/compute/metadata v0.5.0 // indirect
cloud.google.com/go/firestore v1.16.0 // indirect
cloud.google.com/go/iam v1.1.12 // indirect
cloud.google.com/go/longrunning v0.5.11 // indirect
cloud.google.com/go/iam v1.2.0 // indirect
cloud.google.com/go/longrunning v0.6.0 // indirect
cloud.google.com/go/storage v1.43.0 // indirect
github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 // indirect
github.com/KyleBanks/depth v1.2.1 // indirect
github.com/MicahParks/keyfunc v1.9.0 // indirect
github.com/Microsoft/go-winio v0.6.2 // indirect
github.com/Microsoft/hcsshim v0.12.5 // indirect
github.com/Microsoft/hcsshim v0.12.6 // indirect
github.com/andybalholm/brotli v1.1.0 // indirect
github.com/bytedance/sonic v1.11.9 // indirect
github.com/bytedance/sonic/loader v0.1.1 // indirect
github.com/bytedance/sonic v1.12.2 // indirect
github.com/bytedance/sonic/loader v0.2.0 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/cloudflare/circl v1.3.9 // indirect
github.com/cloudflare/circl v1.4.0 // indirect
github.com/cloudwego/base64x v0.1.4 // indirect
github.com/cloudwego/iasm v0.2.0 // indirect
github.com/containerd/cgroups/v3 v3.0.3 // indirect
Expand All @@ -69,14 +69,14 @@ require (
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
github.com/distribution/reference v0.6.0 // indirect
github.com/docker/distribution v2.8.3+incompatible // indirect
github.com/docker/docker v27.1.0+incompatible // indirect
github.com/docker/docker v27.1.1+incompatible // indirect
github.com/docker/go-units v0.5.0 // indirect
github.com/ericlagergren/polyval v0.0.0-20230805202542-18692a1b76f9 // indirect
github.com/ericlagergren/subtle v0.0.0-20220507045147-890d697da010 // indirect
github.com/fatih/structs v1.1.0 // indirect
github.com/felixge/httpsnoop v1.0.4 // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
github.com/gabriel-vasile/mimetype v1.4.4 // indirect
github.com/gabriel-vasile/mimetype v1.4.5 // indirect
github.com/gin-contrib/sse v0.1.0 // indirect
github.com/go-logr/logr v1.4.2 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
Expand All @@ -93,10 +93,10 @@ require (
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/mock v1.6.0 // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/google/pprof v0.0.0-20240722153945-304e4f0156b8 // indirect
github.com/google/pprof v0.0.0-20240829160300-da1f7e9f2b25 // indirect
github.com/google/s2a-go v0.1.8 // indirect
github.com/google/tink/go v1.7.0 // indirect
github.com/googleapis/enterprise-certificate-proxy v0.3.2 // indirect
github.com/googleapis/enterprise-certificate-proxy v0.3.3 // indirect
github.com/googleapis/gax-go/v2 v2.13.0 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
Expand All @@ -119,22 +119,22 @@ require (
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/morikuni/aec v1.0.0 // indirect
github.com/onsi/ginkgo/v2 v2.19.0 // indirect
github.com/onsi/ginkgo/v2 v2.20.2 // indirect
github.com/opencontainers/go-digest v1.0.0 // indirect
github.com/opencontainers/image-spec v1.1.0 // indirect
github.com/opencontainers/runc v1.1.13 // indirect
github.com/pelletier/go-toml/v2 v2.2.2 // indirect
github.com/pelletier/go-toml/v2 v2.2.3 // indirect
github.com/pierrec/lz4/v4 v4.1.21 // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/quic-go/qpack v0.4.0 // indirect
github.com/quic-go/quic-go v0.45.1 // indirect
github.com/quic-go/quic-go v0.46.0 // indirect
github.com/refraction-networking/utls v1.6.7 // indirect
github.com/sagikazarmark/locafero v0.6.0 // indirect
github.com/sagikazarmark/slog-shim v0.1.0 // indirect
github.com/sirupsen/logrus v1.9.3 // indirect
github.com/sourcegraph/conc v0.3.0 // indirect
github.com/spf13/afero v1.11.0 // indirect
github.com/spf13/cast v1.6.0 // indirect
github.com/spf13/cast v1.7.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/subosito/gotenv v1.6.0 // indirect
github.com/swaggo/swag v1.16.3 // indirect
Expand All @@ -143,28 +143,28 @@ require (
github.com/ugorji/go/codec v1.2.12 // indirect
github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect
go.opencensus.io v0.24.0 // indirect
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.53.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.53.0 // indirect
go.opentelemetry.io/otel v1.28.0 // indirect
go.opentelemetry.io/otel/metric v1.28.0 // indirect
go.opentelemetry.io/otel/trace v1.28.0 // indirect
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.54.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.54.0 // indirect
go.opentelemetry.io/otel v1.29.0 // indirect
go.opentelemetry.io/otel/metric v1.29.0 // indirect
go.opentelemetry.io/otel/trace v1.29.0 // indirect
go.uber.org/mock v0.4.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
golang.org/x/arch v0.8.0 // indirect
golang.org/x/crypto v0.25.0 // indirect
golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 // indirect
golang.org/x/mod v0.19.0 // indirect
golang.org/x/oauth2 v0.21.0 // indirect
golang.org/x/sync v0.7.0 // indirect
golang.org/x/sys v0.22.0 // indirect
golang.org/x/text v0.16.0 // indirect
golang.org/x/time v0.5.0 // indirect
golang.org/x/tools v0.23.0 // indirect
golang.org/x/arch v0.9.0 // indirect
golang.org/x/crypto v0.26.0 // indirect
golang.org/x/exp v0.0.0-20240823005443-9b4947da3948 // indirect
golang.org/x/mod v0.20.0 // indirect
golang.org/x/oauth2 v0.22.0 // indirect
golang.org/x/sync v0.8.0 // indirect
golang.org/x/sys v0.24.0 // indirect
golang.org/x/text v0.17.0 // indirect
golang.org/x/time v0.6.0 // indirect
golang.org/x/tools v0.24.0 // indirect
google.golang.org/appengine/v2 v2.0.6 // indirect
google.golang.org/genproto v0.0.0-20240723171418-e6d459c13d2a // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20240723171418-e6d459c13d2a // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240723171418-e6d459c13d2a // indirect
google.golang.org/grpc v1.65.0 // indirect
google.golang.org/genproto v0.0.0-20240827150818-7e3bb234dfed // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20240827150818-7e3bb234dfed // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240827150818-7e3bb234dfed // indirect
google.golang.org/grpc v1.66.0 // indirect
google.golang.org/protobuf v1.34.2 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
Expand Down
Loading

0 comments on commit 972a3e4

Please sign in to comment.