aboutsummaryrefslogtreecommitdiffstats
path: root/skate/xio
diff options
context:
space:
mode:
authorMartin Czygan <martin.czygan@gmail.com>2021-05-28 00:00:35 +0200
committerMartin Czygan <martin.czygan@gmail.com>2021-05-28 00:00:39 +0200
commit56653efe99c699f93c123f07c39bc7e6ccd8c3eb (patch)
tree87b6bb4bbb5bb272e2292079b21e0388e64fcca6 /skate/xio
parent83e6e6576294f0eb0416d7e6d852c7d7fa219a35 (diff)
downloadrefcat-56653efe99c699f93c123f07c39bc7e6ccd8c3eb.tar.gz
refcat-56653efe99c699f93c123f07c39bc7e6ccd8c3eb.zip
include OL work id
Diffstat (limited to 'skate/xio')
-rw-r--r--skate/xio/util.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/skate/xio/util.go b/skate/xio/util.go
index 19651f4..8e1669d 100644
--- a/skate/xio/util.go
+++ b/skate/xio/util.go
@@ -19,6 +19,15 @@ func OpenTwo(f1, f2 string) (g1, g2 *os.File, err error) {
return g1, g2, nil
}
+func TabsToMapFile(filename, sep string, kCol, vCol int) (map[string]string, error) {
+ f, err := os.Open(filename)
+ if err != nil {
+ return nil, err
+ }
+ defer f.Close()
+ return TabsToMap(f, sep, kCol, vCol)
+}
+
// TabsToMap read from a reader and turns values from kCol, vCol columns into a
// mapping.
func TabsToMap(r io.Reader, sep string, kCol, vCol int) (map[string]string, error) {