2019-10-26 00:11:34 +03:00
|
|
|
package costello
|
|
|
|
|
|
|
|
import (
|
|
|
|
"os"
|
|
|
|
"path/filepath"
|
|
|
|
|
|
|
|
"github.com/markbates/pkger/here"
|
|
|
|
)
|
|
|
|
|
|
|
|
type Ref struct {
|
|
|
|
here.Info
|
|
|
|
}
|
|
|
|
|
|
|
|
func NewRef() (*Ref, error) {
|
|
|
|
|
|
|
|
her, err := here.Package("github.com/markbates/pkger")
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
|
|
|
|
dir := filepath.Join(
|
2019-10-30 18:31:39 +03:00
|
|
|
her.Module.Dir,
|
2019-10-26 00:11:34 +03:00
|
|
|
"pkging",
|
|
|
|
"costello",
|
|
|
|
"testdata",
|
|
|
|
"ref")
|
|
|
|
|
|
|
|
if _, err := os.Stat(dir); err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
|
|
|
|
ref := &Ref{
|
|
|
|
Info: here.Info{
|
|
|
|
ImportPath: "app",
|
|
|
|
Dir: dir,
|
2019-10-30 18:31:39 +03:00
|
|
|
Module: here.Module{
|
|
|
|
Path: "app",
|
|
|
|
Dir: dir,
|
|
|
|
},
|
2019-10-26 00:11:34 +03:00
|
|
|
},
|
|
|
|
}
|
|
|
|
|
|
|
|
return ref, nil
|
|
|
|
}
|