From fe06d46a1a6568677736af652eba4f2be8dc50b2 Mon Sep 17 00:00:00 2001 From: ieee0824 Date: Tue, 18 Sep 2018 17:45:50 +0900 Subject: [PATCH] fix edit bug (#101) --- subcmd/vault/edit/v1/v1.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/subcmd/vault/edit/v1/v1.go b/subcmd/vault/edit/v1/v1.go index 4e97aee..6936079 100644 --- a/subcmd/vault/edit/v1/v1.go +++ b/subcmd/vault/edit/v1/v1.go @@ -2,11 +2,12 @@ package v1 import ( "encoding/json" + "os" + "github.com/aws/aws-sdk-go/aws/session" "github.com/ieee0824/cryptex" "github.com/ieee0824/cryptex/kms" "github.com/jobtalk/pnzr/subcmd/vault/edit/util" - "os" ) type Editor struct { @@ -37,7 +38,7 @@ func (e *Editor) Edit(fileName string) error { return err } - w, err := os.OpenFile(fileName, os.O_WRONLY, 0644) + w, err := os.OpenFile(fileName, os.O_TRUNC|os.O_WRONLY, 0644) if err != nil { return err }