Skip to content

Commit

Permalink
chore: removed some unused vars (#4175)
Browse files Browse the repository at this point in the history
Removed some unused vars pointed by
https://github.com/cameron-martin/bazel-lsp (on not yet merged version).

**What type of PR is this?**
Cleanup
  • Loading branch information
hauserx authored Nov 18, 2024
1 parent 5200a61 commit 2dc6308
Show file tree
Hide file tree
Showing 6 changed files with 1 addition and 8 deletions.
1 change: 0 additions & 1 deletion go/private/rules/cross.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ def _go_cross_impl(ctx):
old_default_info = ctx.attr.target[DefaultInfo]
old_executable = old_default_info.files_to_run.executable

new_default_info = None
if old_executable:
# Bazel requires executable rules to created the executable themselves,
# so we create a symlink in this rule so that it appears this rule created its executable.
Expand Down
1 change: 0 additions & 1 deletion go/private/rules/test.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -656,7 +656,6 @@ def _recompile_external_deps(go, external_source, internal_archive, library_labe
i = 0
for label in dep_list:
i += 1
recompile_suffix = ".recompile%d" % i

# If this library is the internal archive, use the recompiled version.
if label == internal_archive.data.label:
Expand Down
2 changes: 0 additions & 2 deletions go/private/rules/transition.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,7 @@ def _go_transition_impl(settings, attr):
pure = "off"
settings["//go/config:pure"] = False
if pure == "on":
race = "off"
settings["//go/config:race"] = False
msan = "off"
settings["//go/config:msan"] = False
cgo = pure == "off"

Expand Down
1 change: 0 additions & 1 deletion go/private/sdk.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,6 @@ def detect_host_platform(ctx):
return goos, goarch

def _detect_host_sdk(ctx):
root = "@invalid@"
if "GOROOT" in ctx.os.environ:
return ctx.os.environ["GOROOT"]
res = ctx.execute([executable_path(ctx, "go"), "env", "GOROOT"])
Expand Down
2 changes: 0 additions & 2 deletions proto/def.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@ load(
GoProtoImports = provider()

def get_imports(attr, importpath):
proto_deps = []

# ctx.attr.proto is a one-element array since there is a Starlark transition attached to it.
if hasattr(attr, "proto") and attr.proto and types.is_list(attr.proto) and ProtoInfo in attr.proto[0]:
proto_deps = [attr.proto[0]]
Expand Down
2 changes: 1 addition & 1 deletion tests/core/go_proto_library_importpath/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
load("@io_bazel_rules_go//go:def.bzl", "go_test")
load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library")
load("@rules_proto//proto:defs.bzl", "proto_library")

Expand Down

0 comments on commit 2dc6308

Please sign in to comment.