diff --git a/pkg/api/static/static_test.go b/pkg/api/static/static_test.go index 2047534cb8d..5bcadfca391 100644 --- a/pkg/api/static/static_test.go +++ b/pkg/api/static/static_test.go @@ -24,7 +24,10 @@ func TestStatic(t *testing.T) { // Create a temporary directory for test files tmpDir, err := os.MkdirTemp("", "static-test") require.NoError(t, err) - defer os.RemoveAll(tmpDir) + defer func() { + err := os.RemoveAll(tmpDir) + require.NoError(t, err) + }() // Create test files testFiles := map[string]string{ @@ -34,7 +37,7 @@ func TestStatic(t *testing.T) { for path, content := range testFiles { fullPath := filepath.Join(tmpDir, path) - err := os.MkdirAll(filepath.Dir(fullPath), 0o755) + err := os.MkdirAll(filepath.Dir(fullPath), 0o750) require.NoError(t, err) err = os.WriteFile(fullPath, []byte(content), 0o644) require.NoError(t, err) diff --git a/pkg/services/ngalert/api/api_ruler_validation_test.go b/pkg/services/ngalert/api/api_ruler_validation_test.go index 802f66362c7..ddf2d2bad1f 100644 --- a/pkg/services/ngalert/api/api_ruler_validation_test.go +++ b/pkg/services/ngalert/api/api_ruler_validation_test.go @@ -10,6 +10,8 @@ import ( "github.com/google/uuid" "github.com/prometheus/common/model" "github.com/stretchr/testify/require" + + //nolint:staticcheck "golang.org/x/exp/rand" "github.com/grafana/grafana/pkg/services/featuremgmt" diff --git a/pkg/services/ngalert/provisioning/accesscontrol_test.go b/pkg/services/ngalert/provisioning/accesscontrol_test.go index 8df47a15634..1b3938b7b24 100644 --- a/pkg/services/ngalert/provisioning/accesscontrol_test.go +++ b/pkg/services/ngalert/provisioning/accesscontrol_test.go @@ -7,6 +7,8 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + + //nolint:staticcheck "golang.org/x/exp/rand" "github.com/grafana/grafana/pkg/apimachinery/identity" diff --git a/pkg/services/ngalert/store/alert_rule_test.go b/pkg/services/ngalert/store/alert_rule_test.go index efe5772934d..ac1c1c57fd3 100644 --- a/pkg/services/ngalert/store/alert_rule_test.go +++ b/pkg/services/ngalert/store/alert_rule_test.go @@ -14,6 +14,8 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "golang.org/x/exp/maps" + + //nolint:staticcheck "golang.org/x/exp/rand" "github.com/grafana/grafana/pkg/bus" diff --git a/pkg/services/ngalert/store/deltas_test.go b/pkg/services/ngalert/store/deltas_test.go index 153fb7cadde..01a13f3c8f5 100644 --- a/pkg/services/ngalert/store/deltas_test.go +++ b/pkg/services/ngalert/store/deltas_test.go @@ -10,6 +10,8 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + + //nolint:staticcheck "golang.org/x/exp/rand" "github.com/grafana/grafana/pkg/services/folder" diff --git a/pkg/storage/unified/apistore/prepare_test.go b/pkg/storage/unified/apistore/prepare_test.go index 634b733ed3a..96c1a2e1243 100644 --- a/pkg/storage/unified/apistore/prepare_test.go +++ b/pkg/storage/unified/apistore/prepare_test.go @@ -7,6 +7,8 @@ import ( "github.com/bwmarrin/snowflake" "github.com/stretchr/testify/require" + + //nolint:staticcheck "golang.org/x/exp/rand" "k8s.io/apimachinery/pkg/api/apitesting" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/pkg/storage/unified/apistore/store.go b/pkg/storage/unified/apistore/store.go index f1c24918cd1..befa4ef0841 100644 --- a/pkg/storage/unified/apistore/store.go +++ b/pkg/storage/unified/apistore/store.go @@ -16,6 +16,7 @@ import ( "strconv" "time" + //nolint:staticcheck "golang.org/x/exp/rand" apierrors "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/api/meta"