func Find(path string) (string, error) {
	var root string
	if err := filepath.Walk(path, func(p string, info os.FileInfo, err error) error {
		if info == nil {
			return nil
		}
		if !info.IsDir() {
			return nil
		}
		dir, e := filepath.Rel(filepath.Join(path), filepath.Join(p))
		if e != nil {
			return nil
		}
		if strings.Contains(dir, fmt.Sprintf("vendor%c", os.PathSeparator)) || strings.Contains(dir, fmt.Sprintf("node_modules%c", os.PathSeparator)) {
			return nil
		}
		if info.Name() == "web" || info.Name() == "public" || info.Name() == "public_html" || info.Name() == "html" {
			root = info.Name()
		}
		if root != "" {
			return nil
		}
		return nil
	}); err != nil {
		return "", err
	}
	if root != "" {
		return root, nil
	}
	return "", ErrNotFound
}
Find takes a path and will check for the web root of the
project. Find will look for web, public, and public_html
directories and return when the first directory match.
If it cannot find the web root it will return an error.
package webroot
import (
	"fmt"
	"os"
	"path/filepath"
	"strings"
)
var (
	ErrNotFound = fmt.Errorf("unable to locate a web root")
)