pkger/examples/complex/api/api.go

18 lines
296 B
Go
Raw Normal View History

2019-10-09 20:21:54 +03:00
package api
import (
"io/ioutil"
"github.com/markbates/pkger"
)
func Version() (string, error) {
f, err := pkger.Open("github.com/markbates/pkger/examples/complex/api:/version.txt")
if err != nil {
return "", err
}
defer f.Close()
b, err := ioutil.ReadAll(f)
return string(b), err
}