structured file with gofmt
This commit is contained in:
parent
5c7325f44a
commit
84421a7c68
1 changed files with 9 additions and 3 deletions
|
@ -28,11 +28,17 @@ func fixpath(name string) string {
|
|||
abspath, err := filepath.Abs(name)
|
||||
if err == nil {
|
||||
// Check if \\?\UNC\ already exist
|
||||
if strings.HasPrefix(abspath, "\\\\?\\UNC\\") { return abspath }
|
||||
if strings.HasPrefix(abspath, "\\\\?\\UNC\\") {
|
||||
return abspath
|
||||
}
|
||||
// Check if \\?\ already exist
|
||||
if strings.HasPrefix(abspath, "\\\\?\\") { return abspath }
|
||||
if strings.HasPrefix(abspath, "\\\\?\\") {
|
||||
return abspath
|
||||
}
|
||||
// Check if path starts with \\
|
||||
if strings.HasPrefix(abspath, "\\\\") { return strings.Replace(abspath, "\\\\", "\\\\?\\UNC\\", 1) }
|
||||
if strings.HasPrefix(abspath, "\\\\") {
|
||||
return strings.Replace(abspath, "\\\\", "\\\\?\\UNC\\", 1)
|
||||
}
|
||||
// Normal path
|
||||
return "\\\\?\\" + abspath
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue