func (fp goFilepath) volumeNameLen(path string) int {
	if !fp.isWindows {
		return 0
	}
	if len(path) < 2 {
		return 0
	}
	c := path[0]
	if path[1] == ':' && ('a' <= c && c <= 'z' || 'A' <= c && c <= 'Z') {
		return 2
	}
	if l := len(path); l >= 5 && isSlash(path[0]) && isSlash(path[1]) &&
		!isSlash(path[2]) && path[2] != '.' {
		for n := 3; n < l-1; n++ {
			if isSlash(path[n]) {
				n++
				if !isSlash(path[n]) {
					if path[n] == '.' {
						break
					}
					for ; n < l; n++ {
						if isSlash(path[n]) {
							break
						}
					}
					return n
				}
				break
			}
		}
	}
	return 0
}
volumeNameLen returns length of the leading volume name on Windows.
It returns 0 elsewhere.
package fs
import (
	"errors"
	"os"
	"strings"
	"syscall"
)
type goFilepath struct {
	cwd           string
	isWindows     bool
	pathSeparator byte
}
func isSlash(c uint8) bool {
	return c == '\\' || c == '/'
}
var reservedNames = []string{
	"CON", "PRN", "AUX", "NUL",
	"COM1", "COM2", "COM3", "COM4", "COM5", "COM6", "COM7", "COM8", "COM9",
	"LPT1", "LPT2", "LPT3", "LPT4", "LPT5", "LPT6", "LPT7", "LPT8", "LPT9",
}
func isReservedName(path string) bool {
	if len(path) == 0 {
		return false
	}
	for _, reserved := range reservedNames {
		if strings.EqualFold(path, reserved) {
			return true
		}
	}
	return false
}
func (fp goFilepath) isAbs(path string) bool {
	if !fp.isWindows {
		return strings.HasPrefix(path, "/")
	}
	if isReservedName(path) {
		return true
	}
	l := fp.volumeNameLen(path)
	if l == 0 {
		return false
	}
	path = path[l:]
	if path == "" {
		return false
	}
	return isSlash(path[0])
}
func (fp goFilepath) abs(path string) (string, error) {
	if fp.isAbs(path) {
		return fp.clean(path), nil
	}
	return fp.join([]string{fp.cwd, path}), nil
}
func (fp goFilepath) isPathSeparator(c uint8) bool {
	return c == '/' || (fp.isWindows && c == '\\')
}