From 7f91f2d5ef4792621aeb42082541899a00441a0f Mon Sep 17 00:00:00 2001 From: vicanso Date: Sat, 19 Feb 2022 10:38:38 +0800 Subject: [PATCH] fix: fix write file for go version < 1.16 --- examples/basic/main.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/basic/main.go b/examples/basic/main.go index 035a7b4..12c0fd6 100644 --- a/examples/basic/main.go +++ b/examples/basic/main.go @@ -1,6 +1,7 @@ package main import ( + "io/ioutil" "os" "path/filepath" @@ -15,7 +16,7 @@ func writeFile(file string, buf []byte) error { } file = filepath.Join(tmpPath, file) - err = os.WriteFile(file, buf, 0600) + err = ioutil.WriteFile(file, buf, 0600) if err != nil { return err }