diff --git a/cmd/kratos/internal/base/install.go b/cmd/kratos/internal/base/install.go index f8e28fe43..1563128a6 100644 --- a/cmd/kratos/internal/base/install.go +++ b/cmd/kratos/internal/base/install.go @@ -7,13 +7,17 @@ import ( "fmt" "os" "os/exec" + "strings" ) // GoInstall go get path. func GoInstall(path ...string) error { for _, p := range path { - fmt.Printf("go install %s@latest\n", p) - cmd := exec.Command("go", "install", fmt.Sprintf("%s@latest", p)) + if !strings.Contains(p, "@") { + p += "@latest" + } + fmt.Printf("go install %s\n", p) + cmd := exec.Command("go", "install", p) cmd.Stdout = os.Stdout cmd.Stderr = os.Stderr if err := cmd.Run(); err != nil { diff --git a/cmd/kratos/internal/upgrade/upgrade.go b/cmd/kratos/internal/upgrade/upgrade.go index 141c8cc5f..5c5f8818d 100644 --- a/cmd/kratos/internal/upgrade/upgrade.go +++ b/cmd/kratos/internal/upgrade/upgrade.go @@ -26,7 +26,7 @@ func Run(cmd *cobra.Command, args []string) { "google.golang.org/grpc/cmd/protoc-gen-go-grpc", "github.com/envoyproxy/protoc-gen-validate", "github.com/google/gnostic", - "github.com/google/gnostic/apps/protoc-gen-openapi", + "github.com/google/gnostic/cmd/protoc-gen-openapi@v0.6.2", ) if err != nil { fmt.Println(err)