From c158e4626aa8d518d2dfbf888d49af0d922acd5f Mon Sep 17 00:00:00 2001 From: Dani Date: Thu, 1 Oct 2020 16:16:32 -0400 Subject: [PATCH] writes only to file and truncate it, so overwrite works as expected (#307) --- cmd/commands/autofix.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/commands/autofix.go b/cmd/commands/autofix.go index 6631f587..6d90771b 100644 --- a/cmd/commands/autofix.go +++ b/cmd/commands/autofix.go @@ -23,7 +23,7 @@ func autofix(cmd *cobra.Command, args []string) { log.WithError(err).Fatal("Error opening out file") } } else { - f, err = os.OpenFile(rootConfig.manifest, os.O_RDWR, 0755) + f, err = os.OpenFile(rootConfig.manifest, os.O_WRONLY|os.O_TRUNC, 0755) if err != nil { log.WithError(err).Fatal("Error opening manifest file") }