Skip to content

Commit

Permalink
chore: mosaic: enable gosec
Browse files Browse the repository at this point in the history
  • Loading branch information
dsonck92 committed Jul 10, 2024
1 parent 3a7b93d commit b491ab4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
1 change: 0 additions & 1 deletion mosaic/.golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ linters:
- cyclop
- prealloc
- lll
- gosec
- gocritic
- funlen
- gocognit
Expand Down
6 changes: 3 additions & 3 deletions mosaic/builder/mosaic_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ func (mb *MosaicBuilder) SetActionOnExistingDirectory(action string) {
func (mb *MosaicBuilder) Build() (*Metadata, error) {
cleanupIfFails := false
if _, err := os.Stat(mb.options.OutputDirectory); os.IsNotExist(err) {
if err := os.MkdirAll(mb.options.OutputDirectory, os.ModePerm); err != nil {
if err := os.MkdirAll(mb.options.OutputDirectory, 0o750); err != nil {
return nil, err
}
cleanupIfFails = true
Expand Down Expand Up @@ -133,7 +133,7 @@ func (mb *MosaicBuilder) Build() (*Metadata, error) {

metadataFilePath := mb.GetMetadataFilePath()
metadataBytes, _ := json.MarshalIndent(metadata, "", " ")
if err := os.WriteFile(metadataFilePath, metadataBytes, os.ModePerm); err != nil {
if err := os.WriteFile(metadataFilePath, metadataBytes, 0o600); err != nil {
return nil, err
}

Expand Down Expand Up @@ -363,7 +363,7 @@ func (mb *MosaicBuilder) CreateDirectory(directory string) {
return
}
}
if err := os.MkdirAll(directory, os.ModePerm); err != nil {
if err := os.MkdirAll(directory, 0o750); err != nil {
return
}
}
Expand Down

0 comments on commit b491ab4

Please sign in to comment.