2020. január 8., szerda 6:37:57 UTC+1 időpontban Eric Chai a következőt írta: > > Moved to https://github.com/kardianos/osext > > On Thursday, March 13, 2014 at 3:54:29 PM UTC+8, Dobrosław Żybort wrote: >> >> Too bad you did not search on stackoverflow: >> http://stackoverflow.com/a/15038241/1722542 >> >> My answer there: >> >> Use package bitbucket.org/kardianos/osext. >> >> It's providing function Executable() that returns an absolute path to >> the current program executable. *It's portable between systems.* >> >> Online documentation <http://godoc.org/bitbucket.org/kardianos/osext> >> >> package main >> import ( >> "bitbucket.org/kardianos/osext" >> "fmt") >> >> func main() { >> filename, _ := osext.Executable() >> fmt.Println(filename)} >> >> >> Best regards, >> Dobrosław Żybort >> >> W dniu czwartek, 13 marca 2014 06:45:20 UTC+1 użytkownik Shark Flh >> napisał: >>> >>> how to get the full path of current process' executable file >>> >>
Dear Thread Necromancer, You're right that kardianos/osext has been moved to github, but 1. that reply is from 2014 2. os.Executable returns the required information since 1.8 (2017-02). 3. kardianos/osext uses os.Executable since 2017-03. 4. It's documented in the README of kardianos/osext that it's obsolete since Go 1.8. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/2bd3745f-ba37-481b-ae15-ef85c588a992%40googlegroups.com.