func ParsePath() (string, error) {
	goModNameOnce.Do(func() {
		dir, err := FindDir()
		if err != nil {
			goModPathErr = fmt.Errorf("find go.mod dir: %w", err)
			return
		}
		p := filepath.Join(dir, "go.mod")
		bs, err := ioutil.ReadFile(p)
		if err != nil {
			goModPathErr = fmt.Errorf("read go.mod: %w", err)
			return
		}
		goModPath = modfile.ModulePath(bs)
	})
	return goModPath, goModPathErr
}
ParsePath finds the module path in the nearest go.mod file.
package gomod
import (
	"fmt"
	"github.com/jschaf/pggen/internal/paths"
	"golang.org/x/mod/modfile"
	"io/ioutil"
	"os"
	"path/filepath"
	"sync"
)
var (
	goModDirOnce = &sync.Once{}
	goModDir     string
	goModDirErr  error
	goModNameOnce = &sync.Once{}
	goModPath     string
	goModPathErr  error
)
func FindDir() (string, error) {
	goModDirOnce.Do(func() {
		wd, err := os.Getwd()
		if err != nil {
			goModDirErr = fmt.Errorf("FindDir working dir: %w", err)
			return
		}
		goModDir, goModDirErr = paths.WalkUp(wd, "go.mod")
	})
	return goModDir, goModDirErr
}