When truncating a file it seems to be adding additional zero bytes to the start:
configFile, err := os.OpenFile("./version.json", os.O_RDWR, 0666)
defer configFile.Close()
check(err)
//some actions happen here
configFile.Truncate(0)
configFile.Write(js)
configFile.Sync()
As a result the file has the contents I write with a section of 0
bytes at the beginning.
How do I truncate and completely rewrite a file without having leading zeros?