Created
March 26, 2018 08:06
-
-
Save danrl/9581c1ff56b0c8f57be170fed0e55635 to your computer and use it in GitHub Desktop.
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
func main() { | |
// read metadata | |
metadataChan := make(chan *line) | |
go reader("metadata.csv", metadataChan) | |
// read strength set IDs | |
strengthSetChan := make(chan *line) | |
go reader("strength_sets.csv", strengthSetChan) | |
// join the two data streams | |
augmentedLinesChan := make(chan *line) | |
go joiner(metadataChan, strengthSetChan, augmentedLinesChan) | |
// write computed lines | |
fmt.Println("id,user_id,machine_id,circle_id,timestamp,strength_set_ids") | |
for l := range augmentedLinesChan { | |
fmt.Printf("%v,%v\n", l.id, l.restOfLine) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment