Skip to content

Commit

Permalink
Merge pull request #91 from testwill/seek
Browse files Browse the repository at this point in the history
chore: os.SEEK_END has been deprecated since Go 1.7
  • Loading branch information
neargle authored Oct 14, 2023
2 parents d9ab557 + 858967a commit c53dbdb
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 c53dbdb

Please sign in to comment.