You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
311 B
Go
18 lines
311 B
Go
package golang
|
|
|
|
import (
|
|
"os"
|
|
"os/exec"
|
|
)
|
|
|
|
func Install(git string) error {
|
|
cmd := exec.Command("go", "install", git)
|
|
env := os.Environ()
|
|
env = append(env, "GO111MODULE=on", "GOPROXY=https://goproxy.cn,direct")
|
|
cmd.Env = env
|
|
cmd.Stdout = os.Stdout
|
|
cmd.Stderr = os.Stderr
|
|
err := cmd.Run()
|
|
return err
|
|
}
|