Skip to content

Add structs.merge #578

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

mattyclarkson
Copy link

one = struct(a = 1)
two = struct(b = 2)
overwrite = struct(a = 3)
merged = structs.merge(one, two , overwrite)
# struct(a = 3, b = 2)

@mattyclarkson mattyclarkson force-pushed the structs.merge branch 4 times, most recently from 2ab03ac to 5b52c11 Compare June 19, 2025 10:47
@mattyclarkson
Copy link
Author

I am unclear why this is failing the buildifier job in the CI.

buildifier (same version as CI) is clean for me locally on lib/structs.bzl, tests/structs_test.bzl, MODULE.bazel and WORKSPACE which have been modified.

Maybe an infra-failure?

`to_json`/`to_proto` function have been removed from `structs`.

Check that they are built-in functions before eliminating the keys.

Tests are gated behind `bazel_features.rules.no_struct_field_denylist` to prevent breakage on old Bazel when running the tests.
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.

2 participants