Skip to content
This repository was archived by the owner on Aug 17, 2025. It is now read-only.

fix: make buildtin inclusion immutable#5319

Merged
jvmakine merged 2 commits intomainfrom
juho/ftl-128-data-race-in-schema-package
May 2, 2025
Merged

fix: make buildtin inclusion immutable#5319
jvmakine merged 2 commits intomainfrom
juho/ftl-128-data-race-in-schema-package

Conversation

@jvmakine
Copy link
Copy Markdown
Contributor

@jvmakine jvmakine commented May 2, 2025

This avoids a data race in the schema service

This avoids a data race in the schema service
@alecthomas alecthomas mentioned this pull request May 2, 2025
@jvmakine jvmakine marked this pull request as ready for review May 2, 2025 01:49
@jvmakine jvmakine requested review from a team and alecthomas as code owners May 2, 2025 01:49
@jvmakine jvmakine merged commit edd46d6 into main May 2, 2025
76 checks passed
@jvmakine jvmakine deleted the juho/ftl-128-data-race-in-schema-package branch May 2, 2025 02:04
Comment thread common/schema/schema.go
// WithBuiltins returns a new schema with the builtins module added to each internal realm.
func (s *Schema) WithBuiltins() *Schema {
c := new(Schema)
*c = *s
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This is not going to be an actual copy right? You'll have to use internal/reflect.DeepCopy() if that's your intent here.

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.

No, this is a shallow copy on purpose. No need for deep copy here.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants