summaryrefslogtreecommitdiff
path: root/registry-scanner/test/fixture/fileutil.go
blob: 7820b72dbc85533d3ca3aff310cf6966af06cc35 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
package fixture

import "os"

// Fixture functions for tests related to files

// MustReadFile must read a file from given path. Panics if it can't.
func MustReadFile(path string) string {
	retBytes, err := os.ReadFile(path)
	if err != nil {
		panic(err)
	}
	return string(retBytes)
}