This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Same data structures as before. | |
// ParseExcerpt parses XML file using XML decoding. | |
func (p *XMLParser) ParseExcerpt(id int, lines <-chan []string, parsed chan<- string, done chan<- int) { | |
proc := 0 // How many excerpts did we process? | |
var stat vehicleStat | |
for excerpt := range lines { | |
if err := xml.Unmarshal([]byte(strings.Join(excerpt, "\n")), &stat); err != nil { | |
panic(err) // We _could_ skip it, but it's better to halt execution here. | |
} |