Find the path to the executable

You can use os.Executable for getting executable path on Go 1.8 or above version. import ( “os” “path” “log” ) func main() { ex, err := os.Executable() if err != nil { log.Fatal(err) } dir := path.Dir(ex) log.Print(dir) }

SVG gradient for perfectly horizontal path

The default for gradientUnits is objectBoundingBox. The key issue you have is described in the last paragraph of the specification text… Keyword objectBoundingBox should not be used when the geometry of the applicable element has no width or no height, such as the case of a horizontal or vertical line, even when the line has … Read more

So what IS the right direction of the path’s slash (/ or \) under Windows?

Windows is the bastard child of operating systems in this regard, but a lot of APIs will accept forward slashes as well. On Windows, a file path looks like this: C:\Users\jsmith\Documents\file.txt On a Unix-like system (including Mac OS X and Linux), the same path would look like this: /home/jsmith/Documents/file.txt A URL, standardized in RFC 1738, … Read more

How to add a set path only for that batch file executing?

Just like any other environment variable, with SET: SET PATH=%PATH%;c:\whatever\else If you want to have a little safety check built in first, check to see if the new path exists first: IF EXIST c:\whatever\else SET PATH=%PATH%;c:\whatever\else If you want that to be local to that batch file, use setlocal: setlocal set PATH=… set OTHERTHING=… @REM … Read more