Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- file, e := os.Open(path)
- if e != nil {...}
- defer file.Close()
- fi, e := file.Stat()
- if e != nil {...}
- data, e := syscall.Mmap(int(file.Fd()), 0, int(fi.Size()), syscall.PROT_READ, syscall.MAP_SHARED)
- if e != nil {...}
- slices := bytes.Split(data, []byte("||"))
- for _, s := range slices {
- str := string(s[:])
- fmt.Println(str)
- }
- slices := bytes.Split(data, []byte("||"))
- s := slices[n - 1]
- str := string(s[:])
- fmt.Println(str)
Add Comment
Please, Sign In to add comment