filosottile / vendorcheck Goto Github PK
View Code? Open in Web Editor NEWCheck that all your Go dependencies are properly vendored
License: MIT License
Check that all your Go dependencies are properly vendored
License: MIT License
Either the tool actually found a problem with one of my projects or it's a false positive:
I run
$ vendorcheck ./...
[!] dependency not vendored: golang.org/x/text/transform
[!] dependency not vendored: golang.org/x/text/encoding/charmap
[!] dependency not vendored: golang.org/x/text/language
[!] dependency not vendored: golang.org/x/text/encoding/internal/identifier
[!] dependency not vendored: golang.org/x/text/encoding
[!] dependency not vendored: golang.org/x/text/encoding/simplifiedchinese
[!] dependency not vendored: golang.org/x/text/internal/utf8internal
[!] dependency not vendored: golang.org/x/text/encoding/korean
[!] dependency not vendored: golang.org/x/text/encoding/unicode
[!] dependency not vendored: golang.org/x/text/encoding/japanese
[!] dependency not vendored: golang.org/x/text/encoding/traditionalchinese
[!] dependency not vendored: golang.org/x/text/runes
[!] dependency not vendored: golang.org/x/text/encoding/htmlindex
[!] dependency not vendored: golang.org/x/text/encoding/internal
[!] dependency not vendored: golang.org/x/text/internal/tag
However, I don't use these packages. They are referenced from vendor/golang.org/x/net/html/charset
of which I vendor vendor/golang.org/x/net
(but only need vendor/golang.org/x/net/context
there), which I can't vendor more fine-grained as I use git submodules and I assume Go compiler would complain as well):
vendor/golang.org/x/net
|- vendor/golang.org/x/net/context
+- vendor/golang.org/x/net/html/charset
+- vendor/golang.org/x/text
Also, could you change the log output from [!]
to Error:
or Warn:
? Then I think it's easier to integrate the tool into go-metalinter.
This would help piping the output to other tools like govendor
or go get
$ go list ./...
github.com/mvdan/interfacer
github.com/mvdan/interfacer/cmd/interfacer
github.com/mvdan/interfacer/generate/std
github.com/mvdan/interfacer/internal/util
github.com/mvdan/interfacer/vendor/github.com/kisielk/gotool
github.com/mvdan/interfacer/vendor/golang.org/x/tools/go/ast/astutil
github.com/mvdan/interfacer/vendor/golang.org/x/tools/go/buildutil
github.com/mvdan/interfacer/vendor/golang.org/x/tools/go/loader
$ vendorcheck
[!] dependency not vendored: github.com/mvdan/interfacer/internal/util
Unless there is something obvious I'm missing here, this sounds like a false positive.
If you have trouble reproducing this, let me know :)
I've only seen this happen once (with Caddy):
$ vendorcheck ./...
$ vendorcheck -u ./...
(bunch of unused vendored packages; not relevant but I'm reporting my full command sequence)
$ go test ./...
caddytls/config.go:12:2: cannot find package "github.com/codahale/aesnicheck" in any of:
/Users/matt/Dev/src/github.com/mholt/caddy/vendor/github.com/codahale/aesnicheck (vendor tree)
/usr/local/go/src/github.com/codahale/aesnicheck (from $GOROOT)
/Users/matt/Dev/src/github.com/codahale/aesnicheck (from $GOPATH)
$ vendorcheck ./...
$ gvt fetch github.com/codahale/aesnicheck
2017/05/27 10:35:09 Fetching: github.com/codahale/aesnicheck
$ vendorcheck ./...
$ go test ./...
(test results; no build errors)
So here go test ./...
noticed that a package was missing but vendorcheck ./...
didn't report it.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.