Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support for modules #32

Closed
deefdragon opened this issue Sep 16, 2018 · 10 comments · Fixed by #49
Closed

support for modules #32

deefdragon opened this issue Sep 16, 2018 · 10 comments · Fixed by #49

Comments

@deefdragon
Copy link

when using go-callvis with a 1.11 module project, I am not able to get an output, I just get a lot of "could nit find x in any of ..."

@sanguohot
Copy link

sanguohot commented Jan 24, 2019

Well, I want this feature too.

@trivigy
Copy link

trivigy commented Apr 12, 2019

Any advice on how to deal with this issue is much appreciated. Here is the printout of what the errors on my end look like.

┌─[trivigy@x1yoga]─[~/Syncaide/Projects/gate]
└─[issue-48]─$ go-callvis -ignore go.uber.org/zap,github.com/spf13/afero,github.com/lestrrat-go/jwx/jwk .
/home/trivigy/.go/pkg/mod/github.com/lestrrat-go/jwx@v0.0.0-20190410064423-01291bc3293a/jwk/certchain.go:7:2: could not import github.com/pkg/errors (cannot find package "github.com/pkg/errors" in any of:
        /usr/local/go/src/github.com/pkg/errors (from $GOROOT)
        /home/trivigy/.go/src/github.com/pkg/errors (from $GOPATH))
/home/trivigy/.go/pkg/mod/github.com/lestrrat-go/jwx@v0.0.0-20190410064423-01291bc3293a/jwk/ecdsa.go:11:2: could not import github.com/lestrrat-go/jwx/internal/base64 (cannot find package "github.com/lestrrat-go/jwx/internal/base64" in any of:
        /usr/local/go/src/github.com/lestrrat-go/jwx/internal/base64 (from $GOROOT)
        /home/trivigy/.go/src/github.com/lestrrat-go/jwx/internal/base64 (from $GOPATH))
/home/trivigy/.go/pkg/mod/github.com/lestrrat-go/jwx@v0.0.0-20190410064423-01291bc3293a/jwk/ecdsa.go:12:2: could not import github.com/lestrrat-go/jwx/jwa (cannot find package "github.com/lestrrat-go/jwx/jwa" in any of:
        /usr/local/go/src/github.com/lestrrat-go/jwx/jwa (from $GOROOT)
        /home/trivigy/.go/src/github.com/lestrrat-go/jwx/jwa (from $GOPATH))
/home/trivigy/.go/pkg/mod/github.com/lestrrat-go/jwx@v0.0.0-20190410064423-01291bc3293a/jwk/ecdsa.go:13:9: could not import github.com/lestrrat-go/pdebug (cannot find package "github.com/lestrrat-go/pdebug" in any of:
        /usr/local/go/src/github.com/lestrrat-go/pdebug (from $GOROOT)
        /home/trivigy/.go/src/github.com/lestrrat-go/pdebug (from $GOPATH))
/home/trivigy/.go/pkg/mod/github.com/lestrrat-go/jwx@v0.0.0-20190410064423-01291bc3293a/jwk/option.go:6:2: could not import github.com/lestrrat-go/jwx/internal/option (cannot find package "github.com/lestrrat-go/jwx/internal/option" in any of:
        /usr/local/go/src/github.com/lestrrat-go/jwx/internal/option (from $GOROOT)
        /home/trivigy/.go/src/github.com/lestrrat-go/jwx/internal/option (from $GOPATH))
/home/trivigy/.go/pkg/mod/github.com/spf13/afero@v1.1.2/memmap.go:25:2: could not import github.com/spf13/afero/mem (go/build: importGo github.com/spf13/afero/mem: exit status 1
error writing go.mod: open /home/trivigy/.go/pkg/mod/github.com/spf13/afero@v1.1.2/go.mod485317572.tmp: permission denied

)
/home/trivigy/.go/pkg/mod/github.com/spf13/afero@v1.1.2/util.go:28:2: could not import golang.org/x/text/transform (go/build: importGo golang.org/x/text/transform: exit status 1
error writing go.mod: open /home/trivigy/.go/pkg/mod/github.com/spf13/afero@v1.1.2/go.mod131271422.tmp: permission denied

)
/home/trivigy/.go/pkg/mod/github.com/spf13/afero@v1.1.2/util.go:29:2: could not import golang.org/x/text/unicode/norm (go/build: importGo golang.org/x/text/unicode/norm: exit status 1
error writing go.mod: open /home/trivigy/.go/pkg/mod/github.com/spf13/afero@v1.1.2/go.mod568267103.tmp: permission denied

)
/home/trivigy/.go/pkg/mod/go.uber.org/zap@v1.9.1/array.go:26:2: could not import go.uber.org/zap/zapcore (cannot find package "go.uber.org/zap/zapcore" in any of:
        /usr/local/go/src/go.uber.org/zap/zapcore (from $GOROOT)
        /home/trivigy/.go/src/go.uber.org/zap/zapcore (from $GOPATH))
/home/trivigy/.go/pkg/mod/go.uber.org/zap@v1.9.1/level.go:24:2: could not import go.uber.org/atomic (cannot find package "go.uber.org/atomic" in any of:
        /usr/local/go/src/go.uber.org/atomic (from $GOROOT)
        /home/trivigy/.go/src/go.uber.org/atomic (from $GOPATH))
/home/trivigy/.go/pkg/mod/go.uber.org/zap@v1.9.1/stacktrace.go:28:2: could not import go.uber.org/zap/internal/bufferpool (cannot find package "go.uber.org/zap/internal/bufferpool" in any of:
        /usr/local/go/src/go.uber.org/zap/internal/bufferpool (from $GOROOT)
        /home/trivigy/.go/src/go.uber.org/zap/internal/bufferpool (from $GOPATH))
/home/trivigy/.go/pkg/mod/go.uber.org/zap@v1.9.1/sugar.go:28:2: could not import go.uber.org/multierr (cannot find package "go.uber.org/multierr" in any of:
        /usr/local/go/src/go.uber.org/multierr (from $GOROOT)
        /home/trivigy/.go/src/go.uber.org/multierr (from $GOPATH))
go-callvis: couldn't load packages due to errors: go.uber.org/zap, github.com/lestrrat-go/jwx/jwk, github.com/spf13/afero

@ondrajz ondrajz added this to TODO in Development Apr 18, 2019
@traitmeta
Copy link

I also encountered this issue.

@asvetlik
Copy link

asvetlik commented Jul 9, 2019

I have encountered the issue as well.

@lthung1504
Copy link

I also ecountered this issue :( can not run for go mod projects

@yonggang985
Copy link

I also encountered this issue.

@joeblubaugh
Copy link

@TrueFurby are you looking for contributors to this project? Adding module support to the library would be a big win for my company as we migrate to go mod.

@marcofranssen
Copy link

I also tried go-callvis today. We are fully on go modules and currently not able to use it with go modules.

FYI: this is how we add tools to our project so we can version them as well using go modules. Would be great if the makefile would not be required and someone can leverage go mod natively to install and version this tool.

We add a tool.go file in the root of our project.

// +build tools

package tools

import (
	_ "github.com/TrueFurby/go-callvis"
	_ "github.com/golangci/golangci-lint/cmd/golangci-lint"
	_ "github.com/goreleaser/goreleaser"
	_ "github.com/spf13/cobra/cobra"
	_ "github.com/tebeka/go2xunit"
	_ "golang.org/x/lint/golint"
	_ "golang.org/x/perf/cmd/benchstat"
	_ "golang.org/x/tools/cmd/stringer"
)

Then to install all tools we use following in our CI to use them.

go mod download
cat tools.go | grep _ | awk -F'"' '{print $2}' | xargs -tI % go install %

I would also recommend using goreleaser to release this tool as a binary.

@medyagh
Copy link

medyagh commented Aug 26, 2019

+1.

@danmartinj
Copy link

+1

@ondrajz ondrajz moved this from TODO to Done in Development May 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging a pull request may close this issue.