func PathForPluginDir(storageDir string, path string, version string) (string, error) {
	pluginPath, err := GetPluginPath(path, version)
	if err != nil {
		return "", err
	}
	return filepath.Join(storageDir, "plugins", pluginPath), nil
}
PathForPluginDir is used to get the local directory where the specified version plug-in should be stored
package pluginmanager
import (
	"net/url"
	"path"
	"path/filepath"
	"strings"
	"golang.org/x/mod/module"
	"github.com/storyicon/powerproto/pkg/util"
)
func PathForInclude(storageDir string) string {
	return filepath.Join(storageDir, "include")
}
func PathForProtoc(storageDir string, version string) string {
	if strings.HasPrefix(version, "v") {
		version = strings.TrimPrefix(version, "v")
	}
	return filepath.Join(storageDir, "protoc", version, util.GetBinaryFileName("protoc"))
}
func GetPluginPath(path string, version string) (string, error) {
	enc, err := module.EscapePath(path)
	if err != nil {
		return "", err
	}
	encVer, err := module.EscapeVersion(version)
	if err != nil {
		return "", err
	}
	return filepath.Join(enc + "@" + encVer), nil
}
func PathForGitReposCode(storageDir string, uri string, commitId string) (string, error) {
	parsed, err := url.Parse(uri)
	if err != nil {
		return "", err
	}
	dir := parsed.Host + parsed.Path
	return filepath.Join(PathForGitRepos(storageDir, commitId), dir), nil
}
func PathForGitRepos(storageDir string, commitId string) string {
	return filepath.Join(storageDir, "gits", commitId)
}