code: func ParseProtoAddr(protoAddr string) (proto string, addr string, err error) {
  
  	if emptyRX.MatchString(protoAddr) {
  		return "", "", ErrParseProtoAddrRequired
  	}
  
  	// If the provided network address does not begin with one
  	// of the valid network protocols then treat the string as a
  	// file path.
  	//
  	// First check to see if the file exists at the specified path.
  	// If it does then assume it's a valid file path and return it.
  	//
  	// Otherwise attempt to create the file. If the file can be created
  	// without error then remove the file and return the result a UNIX
  	// socket file path.
  	if !protoAddrGuessRX.MatchString(protoAddr) {
  
  		// If the file already exists then assume it's a valid sock
  		// file and return it.
  		if _, err := os.Stat(protoAddr); !os.IsNotExist(err) {
  			return "unix", protoAddr, nil
  		}
  
  		f, err := os.Create(protoAddr)
  		if err != nil {
  			return "", "", fmt.Errorf(
  				"invalid implied sock file: %s: %v", protoAddr, err)
  		}
  		if err := f.Close(); err != nil {
  			return "", "", fmt.Errorf(
  				"failed to verify network address as sock file: %s", protoAddr)
  		}
  		if err := os.RemoveAll(protoAddr); err != nil {
  			return "", "", fmt.Errorf(
  				"failed to remove verified sock file: %s", protoAddr)
  		}
  		return "unix", protoAddr, nil
  	}
  
  	// Parse the provided network address into the protocol and address parts.
  	m := protoAddrExactRX.FindStringSubmatch(protoAddr)
  	if m == nil {
  		return "", "", fmt.Errorf("invalid network address: %s", protoAddr)
  	}
  	return m[1], m[2], nil
  }
docs: // ParseProtoAddr parses a Golang network address.