From 5f6760adcfceb9bb68b562da792f123ae18eacb9 Mon Sep 17 00:00:00 2001 From: Peefy Date: Tue, 5 Nov 2024 10:32:34 +0800 Subject: [PATCH] fix: cli output trunc Signed-off-by: Peefy --- pkg/options/run.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/options/run.go b/pkg/options/run.go index 390f7c5..ea47b28 100644 --- a/pkg/options/run.go +++ b/pkg/options/run.go @@ -306,7 +306,7 @@ func (o *RunOptions) writeResult(result *kcl.KCLResultList) error { return err } } else { - file, err := os.OpenFile(o.Output, os.O_CREATE|os.O_RDWR, 0744) + file, err := os.OpenFile(o.Output, os.O_CREATE|os.O_WRONLY|os.O_TRUNC, 0744) if err != nil { return err }