Commit f882d89b authored by G. Hussain Chinoy's avatar G. Hussain Chinoy Committed by Bryan C. Mills

ghchinoy: add example for ioutil.WriteFile

Change-Id: I65c3bda498562fdf39994ec1cadce7947e2d84b5
Reviewed-on: https://go-review.googlesource.com/132277
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: 's avatarBryan C. Mills <bcmills@google.com>
parent 360771e4
......@@ -99,3 +99,11 @@ func ExampleReadFile() {
// Output:
// File contents: Hello, Gophers!
}
func ExampleWriteFile() {
message := []byte("Hello, Gophers!")
err := ioutil.WriteFile("testdata/hello", message, 0644)
if err != nil {
log.Fatal(err)
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment