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()