Go, but with gadgets!
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 lines
498 B

package main
import (
"log"
"os"
"os/exec"
)
func main() {
binPath, err := exec.LookPath("go")
if err != nil {
log.Println("go cannot be found in PATH")
return
}
args := os.Args
if len(args) > 1 {
args = args[1:]
if extPath, err := exec.LookPath("go-" + args[0]); err == nil {
binPath = extPath
if len(args) > 1 {
args = args[1:]
}
}
}
bin := exec.Command(binPath, args...)
bin.Stdin = os.Stdin
bin.Stdout = os.Stdout
bin.Stderr = os.Stderr
_ = bin.Run()
}