Skip to content

Generate definitions parameter for Go binary targets - #375

Merged
chrisnovakovic merged 2 commits into
please-build:masterfrom
chrisnovakovic:please_go-definitions
Sep 2, 2026
Merged

Generate definitions parameter for Go binary targets#375
chrisnovakovic merged 2 commits into
please-build:masterfrom
chrisnovakovic:please_go-definitions

Conversation

@chrisnovakovic

Copy link
Copy Markdown
Contributor

In please_go generate, pass through the given values of -D/--definition to the definitions parameter when generating go_binary and cgo_binary targets.

In `please_go generate`, pass through the given values of
`-D`/`--definition` to the `definitions` parameter when generating
`go_binary` and `cgo_binary` targets.

@toastwaffle toastwaffle left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Wanna add a version bump in this PR?

}

var definitions []string
if kind == "cgo_binary" || kind == "go_binary" {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

would it make sense to future-proof this with strings.HasSuffix(kind, "_binary")?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Think I'd prefer to match explicit strings - there's no guarantee that other targets with a _binary suffix will have a definitions parameter.

Comment thread tools/please_go/please_go.go Outdated
@chrisnovakovic chrisnovakovic changed the title please_go: generate definitions parameter for Go binary targets Generate definitions parameter for Go binary targets Sep 2, 2026
@chrisnovakovic
chrisnovakovic merged commit b7a81b7 into please-build:master Sep 2, 2026
9 of 10 checks passed
@chrisnovakovic
chrisnovakovic deleted the please_go-definitions branch September 2, 2026 12:13
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 this pull request may close these issues.

3 participants