mirror of
https://github.com/zeromicro/go-zero.git
synced 2025-01-24 01:30:25 +08:00
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
|
|
}
|