qrz/vendor/github.com/gobuffalo/here/current.go
Paul Lecuq 36c5d6f2ed
Some checks failed
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is failing
large change on qrz
- web service with json support
- web page
- cron service to update database infos
2020-05-09 19:09:27 +02:00

32 lines
554 B
Go

package here
import (
"path/filepath"
)
// Current returns the Info representing the current Go module
func (h Here) Current() (Info, error) {
hp := &h
(&hp.curOnce).Do(func() {
b, err := run("go", "env", "GOMOD")
if err != nil {
hp.curErr = err
return
}
root := filepath.Dir(string(b))
i, err := h.Dir(root)
if err != nil {
hp.curErr = err
return
}
hp.current = i
})
return h.current, h.curErr
}
// Current returns the Info representing the current Go module
func Current() (Info, error) {
return New().Current()
}