jf-tech / omniparser

omniparser: a native Golang ETL streaming parser and transform library for CSV, JSON, XML, EDI, text, etc.
MIT License
931 stars 68 forks source link

Implement the main `Read` function for `ediReader` #102

Closed jf-tech closed 3 years ago

jf-tech commented 3 years ago

This new implementation avoids running the recursive processing on a separate goroutine and use chan to sync the target returning back to Read(). Instead, it uses a stack and segNext() segDone to make the processing completely non-recursive and in-thread.

codecov[bot] commented 3 years ago

Codecov Report

Merging #102 into master will not change coverage. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##            master      #102   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           37        37           
  Lines         1634      1695   +61     
=========================================
+ Hits          1634      1695   +61     
Impacted Files Coverage Δ
extensions/omniv21/fileformat/edi/seg.go 100.00% <ø> (ø)
idr/jsonreader.go 100.00% <ø> (ø)
idr/xmlreader.go 100.00% <ø> (ø)
extensions/omniv21/fileformat/edi/reader.go 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 59a0dc2...98a8e91. Read the comment docs.