aboutsummaryrefslogtreecommitdiff
path: root/content/playground/os.go
blob: cf0cd32f00c38c5be28ae1e998873bd72b03f3c6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// +build OMIT

package main

import (
	"fmt"
	"io/ioutil"
	"log"
)

func main() {
	const filename = "/tmp/file.txt"

	err := ioutil.WriteFile(filename, []byte("Hello, file system\n"), 0644)
	if err != nil {
		log.Fatal(err)
	}

	b, err := ioutil.ReadFile(filename)
	if err != nil {
		log.Fatal(err)
	}

	fmt.Printf("%s", b)
}