使用 io.SeekStart 替代过时的 os.SEEK_SET。
Signed-off-by: rick.chan <cy@haoan119.com>
This commit is contained in:
parent
6096e1ed16
commit
0a56ef2aca
@ -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')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user