Skip to content

Commit a8896ef

Browse files
committed
feat: embed engine fs inside Store
1 parent cb42a70 commit a8896ef

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

errgoengine.go

+1
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ func (e *ErrgoEngine) Analyze(workingPath, msg string) (*CompiledErrorTemplate,
5757
contextData := NewContextData(e.SharedStore, workingPath)
5858
contextData.Analyzer = template.Language.AnalyzerFactory(contextData)
5959
contextData.AddVariable("message", msg)
60+
contextData.FS = e.FS
6061

6162
// extract variables from the error message
6263
contextData.AddVariables(template.ExtractVariables(msg))

store.go

+3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
package errgoengine
22

3+
import "io/fs"
4+
35
type Store struct {
46
DepGraph DepGraph
57
Documents map[string]*Document
68
Symbols map[string]*SymbolTree
9+
FS fs.ReadFileFS
710
}
811

912
func NewEmptyStore() *Store {

0 commit comments

Comments
 (0)