gorebuild icon indicating copy to clipboard operation
gorebuild copied to clipboard

gorebuild will fail on Windows or other OSes where os.PathSeparator is not '/'.

Open dmitshur opened this issue 9 years ago • 1 comments

I don't see a mention in the README that gorebuild is not supposed to be supported on Windows, yet it has an issue that would prevent it from working there.

Many places in the code assume that os.PathSeparator is /, but that isn't true on Windows and potentially other OSes.

ioutil.ReadDir(build.Default.GOPATH + "/bin")

build.Default.GOPATH+"/bin/"+f.Name()

return strings.TrimPrefix(dir, build.Default.GOPATH+"/src/")

The correct fix for this is to use filepath package to manipulate system filepaths, rather than concatenating strings. E.g.:

ioutil.ReadDir(filepath.Join(build.Default.GOPATH, "bin"))

filepath.Join(build.Default.GOPATH, "bin", f.Name())

dmitshur avatar Jun 13 '16 06:06 dmitshur

This is true, although the more fundamental issue for Windows users is presumably that the code in dwarf.go currently inspects ELF and Mach-O executables only.

frou avatar Dec 30 '16 17:12 frou