You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Works correctly and consistently on go 1.4, 1.5.
Works inconsistently in go 1.6. It behaves differently based on the current directory where the program is executed. If run from the C: drive, fails by not matching and returns an empty list. If run from the E: drive, the exact same binary works and returns 2 matches.
Tested on Windows 2008 R2
Problem description: Using the following glob logic to detect the installation of Git on 32 or 64 bit windows machines. Expect back a list paths of potential 'git.exe' that someone might be using. However, when compiled with 1.6, does not work.
The text was updated successfully, but these errors were encountered:
ianlancetaylor
changed the title
filepath.Glob inconstent behavior beginning in 1.6
path/filepath: Glob inconstent behavior on Windows beginning in 1.6
Mar 24, 2016
Works correctly and consistently on go 1.4, 1.5.
Works inconsistently in go 1.6. It behaves differently based on the current directory where the program is executed. If run from the C: drive, fails by not matching and returns an empty list. If run from the E: drive, the exact same binary works and returns 2 matches.
Tested on Windows 2008 R2
Problem description: Using the following glob logic to detect the installation of Git on 32 or 64 bit windows machines. Expect back a list paths of potential 'git.exe' that someone might be using. However, when compiled with 1.6, does not work.
package main
import (
"fmt"
"path/filepath"
)
func main() {
matches, err := filepath.Glob(
C:\Program Files*\*\bin\git.exe
)if err != nil {
fmt.Println("err=", err)
}
fmt.Println(matches)
}
The text was updated successfully, but these errors were encountered: