Use os.Executable in the standard library now. Or use github.com/kardianos/osext if you need a shim.
os.Executable
github.com/kardianos/osext