I'm trying to only print out the data from a binary file in Go. None of the offset. Here's what I have for printing it out:
func readBinaryFile(filename string) {
file, err := os.Open(filename)
if err != nil {
log.Fatal(err)
}
defer file.Close()
reader := bufio.NewReader(file)
buf := make([]byte, 256)
for {
_, err := reader.Read(buf)
if err != nil {
if err != io.EOF {
fmt.Println(err)
}
break
}
fmt.Printf("%s", hex.Dump(buf))
}
}
func main() {
filename := os.Args[1]
readBinaryFile(filename)
}
how do i remove all the offset it prints? I've tried a thousand things.
