Skip to content

Commit a89ed33

Browse files
committed
docs(plans): say what GoField is in the policy example
A fact carries two names for one field, Field and GoField, and the example gave no reason for the second. Field is the schema's name, which rules match on and which names the column. GoField is the Go struct field that holds the value, which the generator reads from and reuses as the name of the encrypted type's field. Refs #1046 Claude-Session: https://claude.ai/code/session_014jiJy4WhYH2LXojK2jSoxi
1 parent 10e91fd commit a89ed33

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

  • docs/plans/2026-10-04-plan-builder/policy

‎docs/plans/2026-10-04-plan-builder/policy/policy.go‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@ func categories(values ...string) []plan.Annotation {
1616

1717
// Source states the facts a schema reader would produce. A protobuf source
1818
// reads the same facts from descriptors and their custom options.
19+
//
20+
// A fact has two names because the schema and the Go struct spell a field
21+
// differently. Field is the schema's name: rules match on it, and it names
22+
// the column unless plan.Column sets another. GoField is the field of
23+
// individuals.Individual that holds the value, and the generator gives the
24+
// field of EncryptedIndividual the same name. With no GoField, Field is both.
1925
var Source = plan.SourceFunc(func(msg any) ([]plan.Fact, error) {
2026
return []plan.Fact{
2127
{Field: "id", GoField: "ID"},

0 commit comments

Comments
 (0)