jawher / mow.cli

A versatile library for building CLI applications in Go
MIT License
872 stars 55 forks source link

Cannot use func literal (type func(*cli.Cli)) as type cli.CmdInitializer #47

Closed kunashu closed 7 years ago

kunashu commented 7 years ago

Hello,

I'm currently working on an application in a Mac. When trying to do something like my_app.Command("test", "lets see if this works", func(cm *cli.Cli){}) Im getting the following compilation error:

./main.go:12: cannot use func literal (type func(*cli.Cli)) as type cli.CmdInitializer in argument to my_app.Cmd.Command

I have the following version of go installed :go version go1.8.1 darwin/amd64 Reading on the internet some people solved a similar problem with running go get -u, but this doesn't seem to work for me.

jawher commented 7 years ago

@kunashu Can you provide the whole .go file please ?

jawher commented 7 years ago

You should pass *cli.Cmd instead of *cli.Cli.