From 2fde66440ea282532bb1a8e0380e32d331302e39 Mon Sep 17 00:00:00 2001 From: Ben Burwell Date: Tue, 13 Aug 2019 13:08:23 -0400 Subject: truncate files when writing --- apply.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'apply.go') diff --git a/apply.go b/apply.go index 7ea5bf9..eaa528a 100644 --- a/apply.go +++ b/apply.go @@ -42,7 +42,7 @@ func applyFile(name string) error { if err = os.MkdirAll(filepath.Dir(d), 0700); err != nil { return err } - out, err := os.OpenFile(d, os.O_CREATE|os.O_WRONLY, 0600) + out, err := os.OpenFile(d, os.O_CREATE|os.O_WRONLY|os.O_TRUNC, 0600) if err != nil { return err } -- cgit v1.2.3