diff --git a/cloudapi/client.go b/cloudapi/client.go index 5458482ed27..8e0ae945437 100644 --- a/cloudapi/client.go +++ b/cloudapi/client.go @@ -2,12 +2,12 @@ package cloudapi import ( "bytes" + "crypto/rand" "encoding/hex" "encoding/json" "errors" "fmt" "io" - "math/rand" "net/http" "time" @@ -230,15 +230,9 @@ func shouldAddIdempotencyKey(req *http.Request) bool { // randomStrHex returns a hex string which can be used // for session token id or idempotency key. -// -//nolint:gosec func randomStrHex() string { // 16 hex characters b := make([]byte, 8) _, _ = rand.Read(b) return hex.EncodeToString(b) } - -func init() { - rand.Seed(time.Now().UTC().UnixNano()) -} diff --git a/cloudapi/config.go b/cloudapi/config.go index 402b6130b2e..54959d93eb4 100644 --- a/cloudapi/config.go +++ b/cloudapi/config.go @@ -101,7 +101,7 @@ func NewConfig() Config { // Apply saves config non-zero config values from the passed config in the receiver. // -//nolint:funlen,gocognit,cyclop +//nolint:cyclop func (c Config) Apply(cfg Config) Config { if cfg.Token.Valid { c.Token = cfg.Token diff --git a/cloudapi/config_test.go b/cloudapi/config_test.go index e67a2576e14..95d8627e026 100644 --- a/cloudapi/config_test.go +++ b/cloudapi/config_test.go @@ -43,7 +43,7 @@ func TestConfigApply(t *testing.T) { TracesEnabled: null.NewBool(true, true), TracesHost: null.NewString("TracesHost", true), TracesPushInterval: types.NewNullDuration(10*time.Second, true), - TracesPushConcurrency: null.NewInt(6, true), + TracesPushConcurrency: null.NewInt(6, true), } assert.Equal(t, full, full.Apply(empty))