forked from mirror/pkger
22 lines
277 B
Go
22 lines
277 B
Go
|
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
|
||
|
}
|