From 9c8c14286d11387dfa0a6ab26f5eacbd15c725c3 Mon Sep 17 00:00:00 2001 From: Ed Schouten Date: Wed, 9 Oct 2024 14:50:03 +0200 Subject: [PATCH] Make it easier to parse rules_go's .bzl files with Go Starlark (#4140) **What type of PR is this?** Feature **What does this PR do? Why is it needed?** I'm doing some experiments, where I'm trying to parse rules_go's source code with Go Starlark so that I can analyze it. In the process I've noticed that there are some small constructs that Go Starlark doesn't seem to like. In both those cases It looks like Go Starlark works as intended. **Which issues(s) does this PR fix?** n/a **Other notes for review** --- go/private/rules/wrappers.bzl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go/private/rules/wrappers.bzl b/go/private/rules/wrappers.bzl index 22dd77638..b504c57d2 100644 --- a/go/private/rules/wrappers.bzl +++ b/go/private/rules/wrappers.bzl @@ -60,7 +60,7 @@ def go_binary_macro(name, **kwargs): # behaviour, so we forbid this. fail("Cannot use select for go_binary with goos/goarch set, but {} was a select".format(key)) - if kwargs.get("linkmode", default = LINKMODE_NORMAL) in LINKMODES_EXECUTABLE: + if kwargs.get("linkmode", LINKMODE_NORMAL) in LINKMODES_EXECUTABLE: go_binary(name = name, **kwargs) else: go_non_executable_binary(name = name, **kwargs)