From 52a33fd516102a98d3753bf69417235b655a68dc Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Thu, 14 Sep 2017 19:25:01 +0200 Subject: prog: remove default target and all global state Now each prog function accepts the desired target explicitly. No global, implicit state involved. This is much cleaner and allows cross-OS/arch testing, etc. --- prog/parse.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'prog/parse.go') diff --git a/prog/parse.go b/prog/parse.go index 2044b1c9f..c62601702 100644 --- a/prog/parse.go +++ b/prog/parse.go @@ -19,7 +19,7 @@ type LogEntry struct { FaultNth int } -func ParseLog(data []byte) []*LogEntry { +func (target *Target) ParseLog(data []byte) []*LogEntry { var entries []*LogEntry ent := &LogEntry{} var cur []byte @@ -55,7 +55,7 @@ func ParseLog(data []byte) []*LogEntry { continue } tmp := append(cur, line...) - p, err := Deserialize(tmp) + p, err := target.Deserialize(tmp) if err != nil { continue } -- cgit mrf-deployment