Answer prose round 1: loadCallerPath's name and docstring say it loads, and that the caller walks next

This commit is contained in:
2026-10-09 12:39:56 +02:00
committed by Lillem4n
parent 51c0bd518e
commit b9d1af6565
3 changed files with 5 additions and 5 deletions
+1 -1
View File
@@ -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
}
+1 -1
View File
@@ -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
}
+3 -3
View File
@@ -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)