Skip to content
This repository has been archived by the owner on Apr 17, 2023. It is now read-only.

Commit

Permalink
(MAINT) Ignore gosec warning
Browse files Browse the repository at this point in the history
Ignores a gosec warning about using a string variable to define a filepath
for creating a file. The file to be created is the PRM config yaml and it's
filepath needs to be defined in a variable.
  • Loading branch information
petergmurphy authored and michaeltlombardi committed Jan 24, 2022
1 parent 7fdc7b0 commit 0f9c27c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cmd/root/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,8 @@ func InitConfig() {
cfgFilePath := filepath.Join(cfgPath, cfgFile)

if _, err := os.Stat(cfgFilePath); os.IsNotExist(err) {
if _, err := os.Create(cfgFilePath); err != nil {
_, err := os.Create(filepath.Clean(cfgFilePath))
if err != nil {
log.Error().Msgf("failed to initialise %s: %s", cfgFilePath, err)
}
}
Expand Down

0 comments on commit 0f9c27c

Please sign in to comment.