From af1283dfcc2f56d4ac53dda619583f93fe6dfe87 Mon Sep 17 00:00:00 2001 From: Martin Czygan Date: Wed, 5 May 2021 16:15:02 +0200 Subject: cleanup script --- skate/cmd/skate-from-unstructured/main.go | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'skate/cmd/skate-from-unstructured') diff --git a/skate/cmd/skate-from-unstructured/main.go b/skate/cmd/skate-from-unstructured/main.go index 2ccdd7d..8682d8d 100644 --- a/skate/cmd/skate-from-unstructured/main.go +++ b/skate/cmd/skate-from-unstructured/main.go @@ -14,18 +14,20 @@ import ( ) var ( - numWorkers = flag.Int("w", runtime.NumCPU(), "number of workers") - batchSize = flag.Int("b", 100000, "batch size") - bytesNewline = []byte("\n") + numWorkers = flag.Int("w", runtime.NumCPU(), "number of workers") + batchSize = flag.Int("b", 100000, "batch size") ) func main() { pp := parallel.NewProcessor(os.Stdin, os.Stdout, func(p []byte) ([]byte, error) { - var ref skate.Ref - if err := json.Unmarshal(p, &ref); err != nil { + var ( + ref skate.Ref + err error + ) + if err = json.Unmarshal(p, &ref); err != nil { return nil, err } - if err := skate.ParseUnstructured(&ref); err != nil { + if err = skate.ParseUnstructured(&ref); err != nil { return nil, err } return skate.JsonMarshalNewline(&ref) -- cgit v1.2.3