fix: cmd `proto add` nil pointer (#2670)

pull/2675/head
180909 2 years ago committed by GitHub
parent e33d644a78
commit e4595db3d8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      cmd/kratos/internal/proto/add/add.go

@ -20,7 +20,10 @@ var CmdAdd = &cobra.Command{
}
func run(cmd *cobra.Command, args []string) {
// kratos proto add helloworld/v1/helloworld.proto
if len(args) == 0 {
fmt.Println("Please enter the proto file or directory")
return
}
input := args[0]
n := strings.LastIndex(input, "/")
if n == -1 {

Loading…
Cancel
Save