From 56653efe99c699f93c123f07c39bc7e6ccd8c3eb Mon Sep 17 00:00:00 2001 From: Martin Czygan Date: Fri, 28 May 2021 00:00:35 +0200 Subject: include OL work id --- skate/xio/util.go | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'skate/xio') 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) { -- cgit v1.2.3