pkger/pkging/pkgtest/testdata/ref/mod/mod.go

22 lines
277 B
Go
Raw Permalink Normal View History

2019-11-01 22:53:54 +03:00
package mod
import (
"io/ioutil"
"github.com/markbates/pkger"
)
func Mod() (string, error) {
f, err := pkger.Open("/go.mod")
if err != nil {
return "", nil
}
defer f.Close()
b, err := ioutil.ReadAll(f)
if err != nil {
return "", nil
}
return string(b), nil
}