Package dsv is a Go library for working with delimited separated value (DSV).
DSV is a free-style form of CSV format of text data, where each record is separated by newline, and each field can be separated by any string, not just comma.
This is my first Go project and the first release of the package which only work for me only (with all test data is under my supervision). Any input, bug report, and pull request is very welcome.
For an example see the github page [1]. As usual, the source code is in github [1] and documentation in godoc.org [2].
It’s a good job. I only have an issue: why do you want a JSON configuration in a Go library? I think it would be easier to pass some kind of configuration structure.
You can definitely also make a command line tool, using the library (as you show in the examples) and taking as argument the JSON file for configuration.
Thank you, I hope it useful for someone out there.
why do you want a JSON configuration in a Go library? I think it would be easier to pass some kind of configuration structure.
I use JSON because its easy to convert it to Go struct and easy to extended, and I need a quick working library for my next project [1].
The “original” configuration structure actually like this:
LOAD "artist.data" (
:idx : ::',',
'"':name:'"'::
) as artist;
LOAD "album.data" (
'\'':title :'\''::,
:artist_idx:::
) as album;
It was originated from my C project a long long time ago [2]. For a complex configuration like that it will need another parsing function which means more test and test, while I am barely new to Go.
You can definitely also make a command line tool, using the library (as you show in the examples) and taking as argument the JSON file for configuration.
Good idea. I will see if I can do it in my next free time