aboutsummaryrefslogtreecommitdiffstats
path: root/skate/must/file.go
blob: 3c5a3556835498f7542d3a01fdafd4116f8ea1e2 (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
package must

import (
	"io/ioutil"
	"os"
)

// Open opens a file or panics.
func Open(filename string) *os.File {
	f, err := os.Open(filename)
	if err != nil {
		panic(err)
	}
	return f
}

// ReadFile reads a file or panics.
func ReadFile(filename string) []byte {
	b, err := ioutil.ReadFile(filename)
	if err != nil {
		panic(err)
	}
	return b
}