使用 io.SeekStart 替代过时的 os.SEEK_SET。

Signed-off-by: rick.chan <cy@haoan119.com>
This commit is contained in:
rick.chan 2024-10-25 13:17:29 +08:00
parent 6096e1ed16
commit 0a56ef2aca

View File

@ -4,6 +4,7 @@ import (
"bufio" "bufio"
"flag" "flag"
"fmt" "fmt"
"io"
"log" "log"
"os" "os"
"regexp" "regexp"
@ -58,7 +59,7 @@ func insertSpace2Line(line string) string {
func SpacePipeline(file *os.File) []string { func SpacePipeline(file *os.File) []string {
var txt []string var txt []string
file.Seek(0, os.SEEK_SET) file.Seek(0, io.SeekStart)
reader := bufio.NewReader(file) reader := bufio.NewReader(file)
for { for {
line, e := reader.ReadString('\n') line, e := reader.ReadString('\n')