It's idiomatic to defer a Close immediately after opening a file. defer f.Close(). You can Write byte slices as you'd expect. d2 := []byte{115, 111, 109, ...
確定! 回上一頁