From b9d1af6565b6a4bd691e7ebea64a8263a9313317 Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Fri, 9 Oct 2026 12:39:56 +0200 Subject: [PATCH] Answer prose round 1: loadCallerPath's name and docstring say it loads, and that the caller walks next --- record.go | 2 +- render.go | 2 +- shipped.go | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/record.go b/record.go index 61e8ce0..b9a6c78 100644 --- a/record.go +++ b/record.go @@ -125,7 +125,7 @@ func literal(c Column, quote func(string) string, nullText string) string { func (f *Generator) FakeRecord(path string) (*Record, error) { f.mu.Lock() defer f.mu.Unlock() - path, segments, err := f.callerPath(path) + path, segments, err := f.loadCallerPath(path) if err != nil { return nil, err } diff --git a/render.go b/render.go index 09f56e0..c7ead83 100644 --- a/render.go +++ b/render.go @@ -16,7 +16,7 @@ import ( func (f *Generator) Fake(path string) (string, error) { f.mu.Lock() defer f.mu.Unlock() - path, segments, err := f.callerPath(path) + path, segments, err := f.loadCallerPath(path) if err != nil { return "", err } diff --git a/shipped.go b/shipped.go index 407731c..7a2f170 100644 --- a/shipped.go +++ b/shipped.go @@ -58,9 +58,9 @@ func unloadedAt(root *folder, segs []string) (unloadedCategory, bool) { return unloadedCategory{dir: segs[:i:i], in: g, name: segs[i]}, true } -// callerPath is a caller's path without its leading /, and split, with the shipped category -// it names or descends into loaded: a walk is a query and loads nothing. -func (f *Generator) callerPath(path string) (string, []string, error) { +// loadCallerPath strips the / a caller's path may start with, splits the path, and loads the +// shipped category it names or descends into. The caller walks it next, and a walk loads nothing. +func (f *Generator) loadCallerPath(path string) (string, []string, error) { path, err := grammar.CallerPath(path) if err != nil { return "", nil, fmt.Errorf("fejkdata: %w", err)