mkideal / cli

CLI - A package for building command line app with go
MIT License
732 stars 43 forks source link

Something went wrong with dep #44

Closed alxmsl closed 6 years ago

alxmsl commented 6 years ago
  1. Create simple main.go
    
    package main

import ( "github.com/mkideal/cli" )

func main() { cli.HelpCommand("aaa") }

2. Run `dep init`
3. Run `go build`
Result:

$: go build

github.com/alxmsl/temp/vendor/github.com/mkideal/cli

vendor/github.com/mkideal/cli/flag.go:66: cannot convert v (type expr.Value) to type int64 vendor/github.com/mkideal/cli/flag.go:68: cannot convert v (type expr.Value) to type float64

urban-1 commented 6 years ago

I get the same - how do you fix this? Is there a missing dependency?

tyranron commented 6 years ago

@alxmsl @urban-1

By default dep uses not latest master, but latest version tag.

That's why dep downloads for you v0.0.1 tag of this repo instead of master. And in that version such bug is present (conversting struct to int value).

But in latest master this is fixed.

Just use correct [[constraint]] for github.com/mkideal/cli project in your Gopkg.toml:

[[constraint]]
  name = "github.com/mkideal/cli"
  branch = "master"

Or [[override]] if this is a transitive dependency in your project:

[[override]]
  name = "github.com/mkideal/cli"
  branch = "master"
urban-1 commented 6 years ago

Doesn't this worth upping the version to v0.0.2?

(I moved to another lib in order to continue with my development :( )

suntong commented 6 years ago

Please take a look at #46.

mkideal commented 6 years ago

v0.0.2 released totday. I'm so sorry! v0.0.2 is late

suntong commented 6 years ago

Closing it now and feel free to reopen if you have any more questions.