From 858967a9d1377583036cf06a82b48ff99aa816fb Mon Sep 17 00:00:00 2001 From: guoguangwu Date: Thu, 31 Aug 2023 09:44:43 +0800 Subject: [PATCH] chore: os.SEEK_END has been deprecated since Go 1.7 --- pkg/util/file_io.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/util/file_io.go b/pkg/util/file_io.go index 632e15e..dafe46d 100644 --- a/pkg/util/file_io.go +++ b/pkg/util/file_io.go @@ -20,6 +20,7 @@ package util import ( "bufio" "fmt" + "io" "io/ioutil" "log" "os" @@ -91,7 +92,7 @@ func RewriteFile(path string, content string, perm os.FileMode) { if err != nil { log.Fatal("overwrite file:", path, "err: "+err.Error()) } else { - n, _ := cmdFile.Seek(0, os.SEEK_END) + n, _ := cmdFile.Seek(0, io.SeekEnd) _, err = cmdFile.WriteAt([]byte(content), n) log.Println("overwrite file:", path, "success.") defer cmdFile.Close()