func parseModulePathAndVersion(requestPath string) (string, string, error) {
	p := strings.TrimPrefix(requestPath, "/")
	if strings.HasSuffix(p, "/@latest") {
		modulePath := strings.TrimSuffix(p, "/@latest")
		if modulePath == "" {
			return "", "", fmt.Errorf("invalid module path: %q", modulePath)
		}
		return modulePath, internal.LatestVersion, nil
	}
	parts := strings.Split(p, "/@v/")
	if len(parts) != 2 {
		return "", "", fmt.Errorf("invalid path: %q", requestPath)
	}
	if parts[0] == "" || parts[1] == "" {
		return "", "", fmt.Errorf("invalid path: %q", requestPath)
	}
	return parts[0], parts[1], nil
}
// parseModulePathAndVersion returns the module and version specified by p. p
// is assumed to have either of the following two structures:
//   - <module>/@v/<version>
//   - <module>/@latest
// (this is symmetric with the proxy url scheme)
parseModulePathAndVersion returns the module and version specified by p. p
is assumed to have either of the following two structures:
- /@v/
- /@latest
(this is symmetric with the proxy url scheme)
// parseModulePathAndVersion returns the module and version specified by p . p // is assumed to have either of the following two structures : // - <module > / @v / <version > // - <module > / @latest // ( this is symmetric with the proxy url scheme )
func parseModulePathAndVersion(requestPath string) (string, string, error) {
	p := strings.TrimPrefix(requestPath, "/")
	if strings.HasSuffix(p, "/@latest") {
		modulePath := strings.TrimSuffix(p, "/@latest")
		if modulePath == "" {
			return "", "", fmt.Errorf("invalid module path: %q", modulePath)
		}
		return modulePath, internal.LatestVersion, nil
	}
	parts := strings.Split(p, "/@v/")
	if len(parts) != 2 {
		return "", "", fmt.Errorf("invalid path: %q", requestPath)
	}
	if parts[0] == "" || parts[1] == "" {
		return "", "", fmt.Errorf("invalid path: %q", requestPath)
	}
	return parts[0], parts[1], nil
}
func parseModulePathAndVersion ( requestPath string ) ( string , string , error ) { p := strings . TrimPrefix ( requestPath , " " ) if strings . HasSuffix ( p , " " ) { modulePath := strings . TrimSuffix ( p , " " ) if modulePath == " " { return " " , " " , fmt . Errorf ( " " , modulePath ) } return modulePath , internal . LatestVersion , nil } parts := strings . Split ( p , " " ) if len ( parts ) != 2 { return " " , " " , fmt . Errorf ( " " , requestPath ) } if parts [ 0 ] == " " || parts [ 1 ] == " " { return " " , " " , fmt . Errorf ( " " , requestPath ) } return parts [ 0 ] , parts [ 1 ] , nil }
parseModulePathAndVersion returns the module and version specified by p. p
is assumed to have either of the following two structures:
 /@v
 /@latest
(this is symmetric with the proxy url scheme)
parseModulePathAndVersion returns the module and version specified by p . p is assumed to have either of the following two structures : / @v / @latest ( this is symmetric with the proxy url scheme )