t3db0t / jiraToClubhouseCLI

MIT License
15 stars 13 forks source link

Cant get dependency imports to be installed/resolved #4

Closed micksp closed 4 years ago

micksp commented 4 years ago

the program seems to want all kinds of packages installed. I know nothing about "go" and there's no instruction for installation or environment, but tried to fix it anyway. So I installed go: go version go1.13.8 linux/amd64. Then I tried go run main.go, go run *.go go install, as i understand some of those should install the dependencies. But alas... Everything seems ready but the --test command still keeps complaining about several packages missing. Real pitty because I realy need this! Is there any instruction for someone from the "not knowing anything about go" realm?

t3db0t commented 4 years ago

Hi there! I don't actually work with Go regularly, so I don't know the answer off-hand. Also it looks like some dependency management stuff may have changed since i worked on this. What packages were missing? Did you try the dep tool?

t3db0t commented 4 years ago

Looking at the source again, I think there's only one dependency that's not part of the standard library (https://github.com/urfave/cli) but that's supposed to install automatically from the repo. What exactly are the errors you're getting?

micksp commented 4 years ago

Not sure whart you mean by "dep" tool, I'll look into it. Anyway: go run *.go import --in SearchRequest.xml --map userMap.json --token $CLUBHOUSE_API_TOKEN --test jiraStructs.go:10:2: cannot find package "github.com/kennygrant/sanitize" in any of: /opt/go/src/github.com/kennygrant/sanitize (from $GOROOT) /home/sperb003/go/src/github.com/kennygrant/sanitize (from $GOPATH) main.go:13:2: cannot find package "github.com/urfave/cli" in any of: /opt/go/src/github.com/urfave/cli (from $GOROOT) /home/sperb003/go/src/github.com/urfave/cli (from $GOPATH) But this is only the start. If I manually download these packages and put them where the program is looking, the next dependency pops up. (dependency of dependency) I seem to be missing something like an initial setup.

micksp commented 4 years ago

After installing the dep tool and doing a dep init: looks like the program itself needs to be at a certain path/location. I am quite puzzled as to why that would be a good idea, but as said before, I have never done anything with GO so I wont be judgmental ;-). So, I moved the project to ~/go/src. Then I did dep init in that directory, which now worked:

  Locking in v2.0.1 (d3b5b03) for transitive dep github.com/russross/blackfriday
  Locking in v1.0.0 (7bfe4c7) for transitive dep github.com/shurcooL/sanitized_anchor_name
  Using ^1.2.4 as constraint for direct dep github.com/kennygrant/sanitize
  Locking in v1.2.4 (06ec0d0) for direct dep github.com/kennygrant/sanitize
  Locking in master (1617124) for transitive dep golang.org/x/net
  Using ^1.22.0 as constraint for direct dep github.com/urfave/cli
  Locking in v1.22.0 (bfe2e92) for direct dep github.com/urfave/cli
  Locking in v1.0.10 (7762f7e) for transitive dep github.com/cpuguy83/go-md2man

This gives me new errors, although I think the dependencies are now met, so we have some progress!

└─ $ ▶ go run *.go import --in SearchRequest.xml --map userMap.json --token $CLUBHOUSE_API_TOKEN --test
# jiraToClubhouseCLI-master/vendor/github.com/cpuguy83/go-md2man/md2man
vendor/github.com/cpuguy83/go-md2man/md2man/md2man.go:11:16: undefined: blackfriday.EXTENSION_NO_INTRA_EMPHASIS
vendor/github.com/cpuguy83/go-md2man/md2man/md2man.go:12:16: undefined: blackfriday.EXTENSION_TABLES
vendor/github.com/cpuguy83/go-md2man/md2man/md2man.go:13:16: undefined: blackfriday.EXTENSION_FENCED_CODE
vendor/github.com/cpuguy83/go-md2man/md2man/md2man.go:14:16: undefined: blackfriday.EXTENSION_AUTOLINK
vendor/github.com/cpuguy83/go-md2man/md2man/md2man.go:15:16: undefined: blackfriday.EXTENSION_SPACE_HEADERS
vendor/github.com/cpuguy83/go-md2man/md2man/md2man.go:16:16: undefined: blackfriday.EXTENSION_FOOTNOTES
vendor/github.com/cpuguy83/go-md2man/md2man/md2man.go:17:16: undefined: blackfriday.EXTENSION_TITLEBLOCK
vendor/github.com/cpuguy83/go-md2man/md2man/md2man.go:19:29: too many arguments to conversion to blackfriday.Markdown: blackfriday.Markdown(doc, renderer, extensions)
vendor/github.com/cpuguy83/go-md2man/md2man/roff.go:19:9: cannot use &roffRenderer literal (type *roffRenderer) as type blackfriday.Renderer in return argument:
    *roffRenderer does not implement blackfriday.Renderer (missing RenderFooter method)
vendor/github.com/cpuguy83/go-md2man/md2man/roff.go:102:11: undefined: blackfriday.LIST_TYPE_ORDERED
vendor/github.com/cpuguy83/go-md2man/md2man/roff.go:102:11: too many errors
micksp commented 4 years ago

Figured it out (from here) In the Gopkg.toml file:

[[constraint]]
  name = "github.com/gruntwork-io/terratest"
  version = "0.18.3"

Then run dep ensure. After that, it worked!

t3db0t commented 4 years ago

I'm glad you got it working! I'm not sure what would have changed because when I originally wrote this I definitely didn't have to do any of that. It looks like the original problem is that the sanitize dependency wasn't being resolved from github, which it's supposed to automatically do when one runs go install.