diff --git a/plan/plan.go b/plan/plan.go index 3f10bc1..267955d 100644 --- a/plan/plan.go +++ b/plan/plan.go @@ -114,6 +114,19 @@ func (p *Plan) loadImports() error { return nil } +func (p *Plan) loadFiles() error { + for path := range p.files { + f, err := file.New(filepath.Join(p.rootPath, path)) + if err != nil { + return err + } + + p.files[path] = f + } + + return nil +} + // GetDefinition return a value following a path // - `.#Foo` = definition in current plan // - `pkg.#Bar` = definition in package pkg @@ -272,6 +285,10 @@ func (p *Plan) Reload() error { return err } + if err := p.loadFiles(); err != nil { + return err + } + return nil }