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

refactor: fix gosec linter G301 issue #593

Merged
merged 1 commit into from
Aug 13, 2024
Merged
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 chloggen/internal/chlog/entry_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ func TestEntry(t *testing.T) {
func TestReadDeleteEntries(t *testing.T) {
tempDir := t.TempDir()
entriesDir := filepath.Join(tempDir, config.DefaultEntriesDir)
require.NoError(t, os.Mkdir(entriesDir, os.ModePerm))
require.NoError(t, os.Mkdir(entriesDir, 0750))

entryA := Entry{
ChangeLogs: []string{"foo"},
Expand Down
10 changes: 5 additions & 5 deletions internal/repo/repo_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func setupGoMod(t *testing.T, dirs []string) string {

paths := append([]string{root}, prepend(root, dirs...)...)
for _, d := range paths {
require.NoError(t, os.MkdirAll(d, os.ModePerm))
require.NoError(t, os.MkdirAll(d, 0750))
goMod := filepath.Join(d, "go.mod")
f, err := os.Create(filepath.Clean(goMod))
require.NoError(t, err)
Expand All @@ -65,7 +65,7 @@ func TestFindModules(t *testing.T) {
dirs := []string{"a", "a/b", "c"}
root := setupGoMod(t, dirs)
// Add a non-module dir.
require.NoError(t, os.MkdirAll(filepath.Join(root, "tools"), os.ModePerm))
require.NoError(t, os.MkdirAll(filepath.Join(root, "tools"), 0750))

got, err := FindModules(root, nil)
require.NoError(t, err)
Expand Down Expand Up @@ -114,7 +114,7 @@ func setupDocker(t *testing.T, layout []*fPath) string {

}
for _, path := range layout {
require.NoError(t, os.MkdirAll(path.dir, os.ModePerm))
require.NoError(t, os.MkdirAll(path.dir, 0750))

dFile := filepath.Join(path.dir, path.file)
f, err := os.Create(filepath.Clean(dFile))
Expand All @@ -134,7 +134,7 @@ func TestFindDockerfiles(t *testing.T) {
}
root := setupDocker(t, layout)
// Add an empty dir.
require.NoError(t, os.MkdirAll(filepath.Join(root, "tools"), os.ModePerm))
require.NoError(t, os.MkdirAll(filepath.Join(root, "tools"), 0750))

got, err := FindFilePatternDirs(root, "*Dockerfile*", nil)
require.NoError(t, err)
Expand All @@ -159,7 +159,7 @@ func TestFindDockerfilesIgnore(t *testing.T) {
}
root := setupDocker(t, layout)
// Add an empty dir.
require.NoError(t, os.MkdirAll(filepath.Join(root, "tools"), os.ModePerm))
require.NoError(t, os.MkdirAll(filepath.Join(root, "tools"), 0750))

got, err := FindFilePatternDirs(root, "*Dockerfile*", []string{"a/b", "aa/b?", "c"})
require.NoError(t, err)
Expand Down
Loading