Skip to content

Commit

Permalink
fix(golangci-lint): add transitive dependencies
Browse files Browse the repository at this point in the history
This changeset adds two transitive dependencies to the golangci-lint rules:

1. The compiled libraries from the Go SDK, to allow the `govet` linter
   to run without a warning that it can't initialize the standard
   library.
2. The `go` binary from the configured SDK, to ensure the linter always
   uses the same Go binary as the rest of the Bazel build. This also
   allows this rule to execute in environments (or sandboxes) that
   otherwise don't have Go installed.

Bug: atlassian#50
Bug: atlassian#51
  • Loading branch information
terinjokes committed Mar 11, 2019
1 parent 02472d8 commit 70b57b6
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions golangcilint/def.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ def _golangcilint_impl(ctx):
transitive_depsets = [
depset(sdk.srcs),
depset(sdk.tools),
depset(sdk.libs),
depset([sdk.go]),
]
default_runfiles = ctx.attr._golangcilint[DefaultInfo].default_runfiles
if default_runfiles != None:
Expand Down

0 comments on commit 70b57b6

Please sign in to comment.