Skip to content

Commit

Permalink
feat: use os mode instead for manipulating file
Browse files Browse the repository at this point in the history
  • Loading branch information
deryrahman committed May 20, 2024
1 parent cd354e7 commit 0975008
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions client/cmd/job/plan.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import (
"github.com/goto/salt/log"
"github.com/spf13/afero"
"github.com/spf13/cobra"
"golang.org/x/sys/unix"
"gopkg.in/yaml.v2"

"github.com/goto/optimus/client/cmd/internal/logger"
Expand Down Expand Up @@ -214,7 +213,7 @@ func (*planCommand) appendDirectory(directory string, directoryExists map[string
}

func (p *planCommand) saveFile(plans plan.Plans) error {
file, err := os.OpenFile(p.output, unix.O_RDWR|unix.O_CREAT, os.ModePerm)
file, err := os.OpenFile(p.output, os.O_RDWR|os.O_CREATE, os.ModePerm)
if err != nil {
return err
}
Expand Down
3 changes: 1 addition & 2 deletions client/cmd/resource/plan.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import (
"github.com/goto/salt/log"
"github.com/spf13/afero"
"github.com/spf13/cobra"
"golang.org/x/sys/unix"
"gopkg.in/yaml.v2"

"github.com/goto/optimus/client/cmd/internal/logger"
Expand Down Expand Up @@ -213,7 +212,7 @@ func (*planCommand) appendDirectory(directory string, directoryExists map[string
}

func (p *planCommand) saveFile(plans plan.Plans) error {
file, err := os.OpenFile(p.output, unix.O_RDWR|unix.O_CREAT, os.ModePerm)
file, err := os.OpenFile(p.output, os.O_RDWR|os.O_CREATE, os.ModePerm)
if err != nil {
if err != nil {
return err
Expand Down

0 comments on commit 0975008

Please sign in to comment.