goplus / igop

The Go/Go+ Interpreter

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Function pointer type support is incomplete

fly-studio opened this issue · comments

See line 4:

  • the return type of cobra.MinimumNArgs(1) is cobra.PositionalArgs
  • but you must cast the return to cobra.PositionalArgs
  • otherwise, report error: cannot use cobra.MinimumNArgs(1) (value of type cobra.PositionalArgs) as cobra.PositionalArgs value in struct literal
// export in https://github.com/fly-studio/docker-compose/blob/v2/igo/pkgs/github.com/spf13/cobra/go118_export.go
import "github.com/spf13/cobra"
rootCmd := &cobra.Command{
    Args:  cobra.MinimumNArgs(1),
    Run: func(cmd *cobra.Command, args []string) {
	
    },
}

modify to below is ok

Args:  cobra.PositionalArgs(cobra.MinimumNArgs(1))

Why ?