Documentation ¶
Overview ¶
Package gomodtest includes helpers for accessing files and packages inside the current Go Module.
Index ¶
- func ExpandFilepath(t *testing.T, path string) string
- func ExpandPackage(t *testing.T, path string) string
- func ReadFile(t *testing.T, path string) []byte
- func ReadFileJSON(t *testing.T, path string, data interface{})
- func WriteFile(t *testing.T, path string, data []byte)
- func WriteFileJSON(t *testing.T, path string, data interface{})
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExpandFilepath ¶ added in v0.2.13
ExpandPath expands the package path inside tests.
func ExpandPackage ¶
ExpandPackage expands the package name inside tests.
func ReadFileJSON ¶
ReadFileJSON reads from the given path data into the given interface. Fails fatally if reading the file or unmarshalling into the given data structure fails.
func WriteFile ¶
WriteFile writes the given data to the given path, which is being expanded based on the current Go Module.
func WriteFileJSON ¶
WriteFileJSON writes the given data as JSON to the given path, which is being expanded based on the current Go Module.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.