upgrade.go 437 B

1234567891011121314151617181920
  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. // Upgrade gets the latest goctl by
  8. // go get -u github.com/tal-tech/go-zero/tools/goctl
  9. func Upgrade(_ *cli.Context) error {
  10. info, err := execx.Run("GO111MODULE=on GOPROXY=https://goproxy.cn/,direct go get -u github.com/tal-tech/go-zero/tools/goctl", "")
  11. if err != nil {
  12. return err
  13. }
  14. fmt.Print(info)
  15. return nil
  16. }