Golang os/exec.LookPath() function example
package os
Golang os/exec.LookPath() function usage example
package main
import (
"fmt"
"os/exec"
)
func main() {
path, err := exec.LookPath("dig")
if err != nil {
panic(err)
}
fmt.Println("Will be executing the binary at :", path)
}
References :
Advertisement
Something interesting
Tutorials
+15.6k Golang : ROT47 (Caesar cipher by 47 characters) example
+5.9k Golang : Use NLP to get sentences for each paragraph example
+4.8k PHP : Extract part of a string starting from the middle
+7.5k Golang : Dealing with struct's private part
+12.3k Golang : Flush and close file created by os.Create and bufio.NewWriter example
+14.5k Golang : Overwrite previous output with count down timer
+17.2k Golang : When to use init() function?
+9k Golang : Capture text return from exec function example
+20.2k Golang : Count number of digits from given integer value
+12.5k Golang : HTTP response JSON encoded data
+10.9k Golang : Create Temporary File
+7.9k Golang : Ways to recover memory during run time.