You must flush the buffered writer.
func main() { f, _ := os.Create("bebra.txt") defer f.Close() w := bufio.NewWriter(f) fmt.Fprint(w, "bebra") w.Flush() // Add this line! }