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

Enhance Go dependency resolver to resolve built-in and non-standard Go modules #46

Merged
merged 1 commit into from
Jul 23, 2021

Conversation

kezhenxu94
Copy link
Member

@kezhenxu94 kezhenxu94 commented Jul 22, 2021

This patch enhances the Go dependency resolver, previously for some dependencies we are not able to resolve them, now it's able to find all modules.

example output

go run cmd/license-eye/main.go d r 
INFO GITHUB_TOKEN is not set, license-eye won't comment on the pull request 
INFO Loading configuration from file: .licenserc.yaml 
WARNING Failed to resolve the license of dependency: github.com/pascaldekloe/goe cannot identify license content 
Dependency                                         |        License
-------------------------------------------------- | --------------
github.com/apache/skywalking-eyes/license-eye      |     Apache-2.0
cloud.google.com/go                                |     Apache-2.0
cloud.google.com/go/bigquery                       |     Apache-2.0
cloud.google.com/go/datastore                      |     Apache-2.0
cloud.google.com/go/firestore                      |     Apache-2.0
cloud.google.com/go/pubsub                         |     Apache-2.0
cloud.google.com/go/storage                        |     Apache-2.0
dmitri.shuralyov.com/gpu/mtl                       |   BSD-3-Clause
github.com/BurntSushi/xgb                          |   BSD-3-Clause
github.com/OneOfOne/xxhash                         |     Apache-2.0
github.com/alecthomas/template                     |   BSD-3-Clause
github.com/armon/circbuf                           |            MIT
github.com/armon/go-metrics                        |            MIT
github.com/armon/go-radix                          |            MIT
github.com/beorn7/perks                            |            MIT
github.com/bgentry/speakeasy                       |            MIT
github.com/bketelsen/crypt                         |            MIT
github.com/bmatcuk/doublestar/v2                   |            MIT
github.com/cespare/xxhash                          |            MIT
github.com/client9/misspell                        |            MIT
github.com/coreos/bbolt                            |            MIT
github.com/coreos/etcd                             |     Apache-2.0
github.com/coreos/go-semver                        |     Apache-2.0
github.com/coreos/go-systemd                       |     Apache-2.0
github.com/coreos/pkg                              |     Apache-2.0
github.com/cpuguy83/go-md2man/v2                   |            MIT
github.com/davecgh/go-spew                         |            ISC
github.com/dgrijalva/jwt-go                        |            MIT
github.com/dgryski/go-sip13                        |            MIT
github.com/fatih/color                             |            MIT
github.com/fsnotify/fsnotify                       |   BSD-3-Clause
github.com/ghodss/yaml                             |   BSD-3-Clause
github.com/go-gl/glfw                              |   BSD-3-Clause
github.com/go-kit/kit                              |            MIT
github.com/go-logfmt/logfmt                        |            MIT
github.com/go-stack/stack                          |            MIT
github.com/gogo/protobuf                           |   BSD-3-Clause
github.com/golang/glog                             |     Apache-2.0
github.com/golang/groupcache                       |     Apache-2.0
github.com/golang/mock                             |     Apache-2.0
github.com/golang/protobuf                         |   BSD-3-Clause
github.com/google/btree                            |     Apache-2.0
github.com/google/go-cmp                           |   BSD-3-Clause
github.com/google/go-github/v33                    |   BSD-3-Clause
github.com/google/go-querystring                   |   BSD-3-Clause
github.com/google/martian                          |     Apache-2.0
github.com/google/pprof                            |     Apache-2.0
github.com/google/renameio                         |     Apache-2.0
github.com/googleapis/gax-go/v2                    |   BSD-3-Clause
github.com/gopherjs/gopherjs                       |   BSD-2-Clause
github.com/gorilla/websocket                       |   BSD-2-Clause
github.com/grpc-ecosystem/go-grpc-middleware       |     Apache-2.0
github.com/grpc-ecosystem/go-grpc-prometheus       |     Apache-2.0
github.com/grpc-ecosystem/grpc-gateway             |   BSD-3-Clause
github.com/hashicorp/consul/api                    |        MPL-2.0
github.com/hashicorp/consul/sdk                    |        MPL-2.0
github.com/hashicorp/errwrap                       |        MPL-2.0
github.com/hashicorp/go-cleanhttp                  |        MPL-2.0
github.com/hashicorp/go-immutable-radix            |        MPL-2.0
github.com/hashicorp/go-msgpack                    |   BSD-3-Clause
github.com/hashicorp/go-multierror                 |        MPL-2.0
github.com/hashicorp/go-rootcerts                  |        MPL-2.0
github.com/hashicorp/go-sockaddr                   |        MPL-2.0
github.com/hashicorp/go-syslog                     |            MIT
github.com/hashicorp/go-uuid                       |        MPL-2.0
github.com/hashicorp/go.net                        |   BSD-3-Clause
github.com/hashicorp/golang-lru                    |        MPL-2.0
github.com/hashicorp/hcl                           |        MPL-2.0
github.com/hashicorp/logutils                      |        MPL-2.0
github.com/hashicorp/mdns                          |            MIT
github.com/hashicorp/memberlist                    |        MPL-2.0
github.com/hashicorp/serf                          |        MPL-2.0
github.com/inconshreveable/mousetrap               |     Apache-2.0
github.com/jonboulle/clockwork                     |     Apache-2.0
github.com/json-iterator/go                        |            MIT
github.com/jstemmer/go-junit-report                |            MIT
github.com/jtolds/gls                              |            MIT
github.com/julienschmidt/httprouter                |   BSD-3-Clause
github.com/kisielk/errcheck                        |            MIT
github.com/kisielk/gotool                          |            MIT
github.com/konsorten/go-windows-terminal-sequences |            MIT
github.com/kr/pretty                               |            MIT
github.com/kr/pty                                  |            MIT
github.com/kr/text                                 |            MIT
github.com/magiconair/properties                   |   BSD-2-Clause
github.com/mattn/go-colorable                      |            MIT
github.com/mattn/go-isatty                         |            MIT
github.com/matttproud/golang_protobuf_extensions   |     Apache-2.0
github.com/miekg/dns                               |   BSD-3-Clause
github.com/mitchellh/cli                           |        MPL-2.0
github.com/mitchellh/go-homedir                    |            MIT
github.com/mitchellh/go-testing-interface          |            MIT
github.com/mitchellh/gox                           |        MPL-2.0
github.com/mitchellh/iochan                        |            MIT
github.com/mitchellh/mapstructure                  |            MIT
github.com/modern-go/concurrent                    |     Apache-2.0
github.com/modern-go/reflect2                      |     Apache-2.0
github.com/mwitkow/go-conntrack                    |     Apache-2.0
github.com/oklog/ulid                              |     Apache-2.0
github.com/pelletier/go-toml                       |            MIT
github.com/pkg/errors                              |   BSD-2-Clause
github.com/pmezard/go-difflib                      |   BSD-3-Clause
github.com/posener/complete                        |            MIT
github.com/prometheus/client_golang                |     Apache-2.0
github.com/prometheus/client_model                 |     Apache-2.0
github.com/prometheus/common                       |     Apache-2.0
github.com/prometheus/procfs                       |     Apache-2.0
github.com/prometheus/tsdb                         |     Apache-2.0
github.com/rogpeppe/fastuuid                       |   BSD-3-Clause
github.com/rogpeppe/go-internal                    |   BSD-3-Clause
github.com/russross/blackfriday/v2                 |   BSD-2-Clause
github.com/sean-/seed                              |   BSD-3-Clause
github.com/shurcooL/sanitized_anchor_name          |            MIT
github.com/sirupsen/logrus                         |            MIT
github.com/smartystreets/assertions                |            MIT
github.com/smartystreets/goconvey                  |            MIT
github.com/soheilhy/cmux                           |     Apache-2.0
github.com/spaolacci/murmur3                       |   BSD-3-Clause
github.com/spf13/afero                             |     Apache-2.0
github.com/spf13/cast                              |            MIT
github.com/spf13/cobra                             |     Apache-2.0
github.com/spf13/jwalterweatherman                 |            MIT
github.com/spf13/pflag                             |   BSD-3-Clause
github.com/spf13/viper                             |            MIT
github.com/stretchr/objx                           |            MIT
github.com/stretchr/testify                        |            MIT
github.com/subosito/gotenv                         |            MIT
github.com/tmc/grpc-websocket-proxy                |            MIT
github.com/xiang90/probing                         |            MIT
github.com/yuin/goldmark                           |            MIT
go.etcd.io/bbolt                                   |            MIT
go.opencensus.io                                   |     Apache-2.0
go.uber.org/atomic                                 |            MIT
go.uber.org/multierr                               |            MIT
go.uber.org/zap                                    |            MIT
golang.org/x/crypto                                |   BSD-3-Clause
golang.org/x/exp                                   |   BSD-3-Clause
golang.org/x/image                                 |   BSD-3-Clause
golang.org/x/lint                                  |   BSD-3-Clause
golang.org/x/mobile                                |   BSD-3-Clause
golang.org/x/mod                                   |   BSD-3-Clause
golang.org/x/net                                   |   BSD-3-Clause
golang.org/x/oauth2                                |   BSD-3-Clause
golang.org/x/sync                                  |   BSD-3-Clause
golang.org/x/sys                                   |   BSD-3-Clause
golang.org/x/term                                  |   BSD-3-Clause
golang.org/x/text                                  |   BSD-3-Clause
golang.org/x/time                                  |   BSD-3-Clause
golang.org/x/tools                                 |   BSD-3-Clause
golang.org/x/xerrors                               |   BSD-3-Clause
google.golang.org/api                              |   BSD-3-Clause
google.golang.org/appengine                        |     Apache-2.0
google.golang.org/genproto                         |     Apache-2.0
google.golang.org/grpc                             |     Apache-2.0
gopkg.in/check.v1                                  |   BSD-2-Clause
gopkg.in/errgo.v2                                  |   BSD-3-Clause
gopkg.in/ini.v1                                    |     Apache-2.0
gopkg.in/resty.v1                                  |            MIT
gopkg.in/yaml.v2                                   |     Apache-2.0
gopkg.in/yaml.v3                                   | MIT and Apache
honnef.co/go/tools                                 |            MIT
rsc.io/binaryregexp                                |   BSD-3-Clause
github.com/pascaldekloe/goe                        |        Unknown

ERROR failed to identify the licenses of following packages (1):
github.com/pascaldekloe/goe 
exit status 1

@kezhenxu94 kezhenxu94 added the enhancement New feature or request label Jul 22, 2021
@kezhenxu94 kezhenxu94 added this to the 0.2.0 milestone Jul 22, 2021
@kezhenxu94 kezhenxu94 requested review from wu-sheng and fgksgf July 22, 2021 09:16
@kezhenxu94
Copy link
Member Author

FYI @zooltd @MoGuGuai-hzr

@kezhenxu94 kezhenxu94 force-pushed the enhance/go-mod branch 5 times, most recently from 51b6ceb to b02b14e Compare July 22, 2021 09:49
@MoGuGuai-hzr
Copy link
Contributor

Nice, Nice, Nice. It is better than I thought about using go list to get the std package.

FYI @zooltd @MoGuGuai-hzr

@kezhenxu94 kezhenxu94 force-pushed the enhance/go-mod branch 2 times, most recently from 3ac5d59 to 6e2357d Compare July 22, 2021 13:53
Copy link
Member

@fgksgf fgksgf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MoGuGuai-hzr reviewed on my behalf :P

@kezhenxu94 kezhenxu94 merged commit 1a8f2ea into main Jul 23, 2021
@kezhenxu94 kezhenxu94 deleted the enhance/go-mod branch July 23, 2021 03:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants