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

Depending on this project ends up pulling in lots of dependencies #35

Closed
kevinburke1 opened this issue Feb 24, 2020 · 5 comments · Fixed by #36
Closed

Depending on this project ends up pulling in lots of dependencies #35

kevinburke1 opened this issue Feb 24, 2020 · 5 comments · Fixed by #36

Comments

@kevinburke1
Copy link

I vendor dependencies in my project. Due to the "tools.go" imports in this file, I'm now vendoring all of the staticcheck project. This seems like overkill for a library that is designed to handle multiple errors.

Perhaps you could move the imports in tools.go to a different place, like the private repositories at Uber?

@abhinav
Copy link
Collaborator

abhinav commented Feb 24, 2020

Hey, thanks for reporting! This is a good point. This is fixable by moving
tools dependencies into a submodule that is never published.

ROOT
  |- go.mod   // go.uber.org/multierr
  |- tools/
      go.mod  // go.uber.org/multierr/tools
      tools.go

We'll fix this shortly.

@kevinburke1
Copy link
Author

Thanks!

@abhinav
Copy link
Collaborator

abhinav commented Feb 24, 2020

Oh, a simpler solution is to move tools.go to tools_test.go. Go modules will ignore the test files and their dependencies.

abhinav added a commit to uber-go/atomic that referenced this issue Feb 24, 2020
We use `golang.org/x/{tools,lint}` for dev-time tooling only. We don't
need to declare it as a library dependency. This causes issues like
uber-go/multierr#35.

This change drops these depnedencies by renaming the tools.go so that
these are considered test dependencies only. `go mod vendor` does not
consider test dependencies.
abhinav added a commit to uber-go/atomic that referenced this issue Feb 24, 2020
We use `golang.org/x/{tools,lint}` for dev-time tooling only. We don't
need to declare it as a library dependency. This causes issues like
uber-go/multierr#35.

This change drops these depnedencies by renaming the tools.go so that
these are considered test dependencies only. `go mod vendor` does not
consider test dependencies.
abhinav added a commit that referenced this issue Feb 24, 2020
This drops library-level dependencies on tools used during development.
See also uber-go/atomic#65.

Note that we'll also tag a release when this lands.

Resolves #35
abhinav added a commit that referenced this issue Feb 24, 2020
This drops library-level dependencies on tools used during development.
See also uber-go/atomic#65.

Note that we'll also tag a release when this lands.

Resolves #35
@abhinav
Copy link
Collaborator

abhinav commented Feb 24, 2020

@kevinburkemeter v1.5.0 should not have this issue. Thanks again for reporting.

@kevinburke1
Copy link
Author

kevinburke1 commented Feb 25, 2020 via email

r-hang added a commit to uber-go/config that referenced this issue Apr 15, 2020
We use golang.org/x/lint for dev-time tooling only. We don't
need to declare constraints on versions of these libraries that our
users use.

related: uber-go/multierr#35
r-hang added a commit to yarpc/yarpc-go that referenced this issue Apr 15, 2020
This drops the library-level dependency on development tools.
The tools are:
     "github.com/gogo/protobuf/protoc-gen-gogoslick"
     "github.com/golang/mock/mockgen"
     "github.com/kisielk/errcheck"
     "github.com/uber/tchannel-go/thrift/thrift-gen"
     "go.uber.org/thriftrw"
     "go.uber.org/tools/update-license"
     "golang.org/x/lint/golint"
     "golang.org/x/tools/cmd/stringer"
     "honnef.co/go/tools/cmd/staticcheck"

related: uber-go/multierr#35
r-hang added a commit to yarpc/yarpc-go that referenced this issue Apr 15, 2020
This drops the library-level dependency on development tools.
The tools are:
     "github.com/gogo/protobuf/protoc-gen-gogoslick"
     "github.com/golang/mock/mockgen"
     "github.com/kisielk/errcheck"
     "github.com/uber/tchannel-go/thrift/thrift-gen"
     "go.uber.org/thriftrw"
     "go.uber.org/tools/update-license"
     "golang.org/x/lint/golint"
     "golang.org/x/tools/cmd/stringer"
     "honnef.co/go/tools/cmd/staticcheck"

related: uber-go/multierr#35
r-hang added a commit to yarpc/yarpc-go that referenced this issue Apr 15, 2020
This drops the library-level dependency on development tools.
The tools are:
     "github.com/gogo/protobuf/protoc-gen-gogoslick"
     "github.com/golang/mock/mockgen"
     "github.com/kisielk/errcheck"
     "github.com/uber/tchannel-go/thrift/thrift-gen"
     "go.uber.org/thriftrw"
     "go.uber.org/tools/update-license"
     "golang.org/x/lint/golint"
     "golang.org/x/tools/cmd/stringer"
     "honnef.co/go/tools/cmd/staticcheck"

related: uber-go/multierr#35
peats-bond pushed a commit to yarpc/yarpc-go that referenced this issue Apr 15, 2020
This drops the library-level dependency on development tools.
The tools are:
     "github.com/gogo/protobuf/protoc-gen-gogoslick"
     "github.com/golang/mock/mockgen"
     "github.com/kisielk/errcheck"
     "github.com/uber/tchannel-go/thrift/thrift-gen"
     "go.uber.org/thriftrw"
     "go.uber.org/tools/update-license"
     "golang.org/x/lint/golint"
     "golang.org/x/tools/cmd/stringer"
     "honnef.co/go/tools/cmd/staticcheck"

related: uber-go/multierr#35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants