// Returns the root dir where the go.mod located.
Returns the root dir where the go.mod located.
// Returns the root dir where the go . mod located .
func GetProjectRoot() (string, error) {
	wd, err := os.Getwd()
	if err != nil {
		return wd, err
	}
	return FindFileInDirAndParents(wd, "go.mod")
}
func GetProjectRoot ( ) ( string , error ) { wd , err := os . Getwd ( ) if err != nil { return wd , err } return FindFileInDirAndParents ( wd , " " ) }
Returns the root dir where the go.mod located.
Returns the root dir where the go . mod located .
// Get the current directory.