upgrade.go 348 B

123456789101112131415161718
  1. package upgrade
  2. import (
  3. "fmt"
  4. "github.com/tal-tech/go-zero/tools/goctl/rpc/execx"
  5. "github.com/urfave/cli"
  6. )
  7. func Upgrade(_ *cli.Context) error {
  8. info, err := execx.Run("GO111MODULE=on GOPROXY=https://goproxy.cn/,direct go get -u github.com/tal-tech/go-zero/tools/goctl", "")
  9. if err != nil {
  10. return err
  11. }
  12. fmt.Print(info)
  13. return nil
  14. }