Skip to content

Commit

Permalink
bugfix: use os.Create to write files (#2175)
Browse files Browse the repository at this point in the history
  • Loading branch information
kakaZhou719 authored Apr 10, 2023
1 parent 006e1db commit 70bb9ff
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/env/env.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func RenderTemplate(dir string, renderData map[string]interface{}) error {
if info.IsDir() || !strings.HasSuffix(info.Name(), templateSuffix) {
return nil
}
writer, err := os.OpenFile(strings.TrimSuffix(path, templateSuffix), os.O_CREATE|os.O_RDWR, os.ModePerm)
writer, err := os.Create(strings.TrimSuffix(path, templateSuffix))
if err != nil {
return fmt.Errorf("failed to open file [%s] when render env: %v", path, err)
}
Expand Down

0 comments on commit 70bb9ff

Please sign in to comment.