You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Here, @extern(embed) only affects its file, and not any other files part of the same instance of package foo.
Any top-level attributes after a package clause (or without a package clause) are attached to the package (or rather its instance), so they do get unified as part of it and affect all other files which are part of the same instance. For example:
package foo
@go(some_go_code_generation_option)
Here, the attribute will affect how e.g. cue exp gengotypes generates Go code for the entire CUE package instance.
https://cuelang.org/docs/reference/spec/#attributes needs to be expanded; it currently only explains package attributes, showing one brief example. It needs to explain file-scoped attributes too, and show an example of them too.
The text was updated successfully, but these errors were encountered:
CUE currently supports attributes attached to just one file, such as:
Here,
@extern(embed)
only affects its file, and not any other files part of the same instance ofpackage foo
.Any top-level attributes after a package clause (or without a package clause) are attached to the package (or rather its instance), so they do get unified as part of it and affect all other files which are part of the same instance. For example:
Here, the attribute will affect how e.g.
cue exp gengotypes
generates Go code for the entire CUE package instance.https://cuelang.org/docs/reference/spec/#attributes needs to be expanded; it currently only explains package attributes, showing one brief example. It needs to explain file-scoped attributes too, and show an example of them too.
The text was updated successfully, but these errors were encountered: