aboutsummaryrefslogtreecommitdiffstats
path: root/skate
diff options
context:
space:
mode:
authorMartin Czygan <martin.czygan@gmail.com>2021-05-05 16:15:02 +0200
committerMartin Czygan <martin.czygan@gmail.com>2021-05-05 16:15:02 +0200
commitaf1283dfcc2f56d4ac53dda619583f93fe6dfe87 (patch)
treee6a919b890ff2009bfff4f97866111c4c43fe7fe /skate
parent048641f7672e2ff04a80d4486d0c21bd61369f0f (diff)
downloadrefcat-af1283dfcc2f56d4ac53dda619583f93fe6dfe87.tar.gz
refcat-af1283dfcc2f56d4ac53dda619583f93fe6dfe87.zip
cleanup script
Diffstat (limited to 'skate')
-rw-r--r--skate/cmd/skate-from-unstructured/main.go14
1 files changed, 8 insertions, 6 deletions
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)