Skip to content

Commit

Permalink
chore: os.SEEK_END has been deprecated since Go 1.7
Browse files Browse the repository at this point in the history
  • Loading branch information
testwill committed Aug 31, 2023
1 parent d9ab557 commit 858967a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/util/file_io.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ package util
import (
"bufio"
"fmt"
"io"
"io/ioutil"
"log"
"os"
Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit 858967a

Please sign in to comment.