diff options
author | Martin Czygan <martin.czygan@gmail.com> | 2021-05-06 19:47:35 +0200 |
---|---|---|
committer | Martin Czygan <martin.czygan@gmail.com> | 2021-05-06 19:47:35 +0200 |
commit | b46c9d351aa0a2a5c3618a1420259d4605a9654e (patch) | |
tree | 376f55f59baf657397210b2a2a3724b9ba61f6bb /skate/xio/util.go | |
parent | fb627564751d170c55b45785da569268b6290be9 (diff) | |
download | refcat-b46c9d351aa0a2a5c3618a1420259d4605a9654e.tar.gz refcat-b46c9d351aa0a2a5c3618a1420259d4605a9654e.zip |
move skate-verify to skate-reduce
Diffstat (limited to 'skate/xio/util.go')
-rw-r--r-- | skate/xio/util.go | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/skate/xio/util.go b/skate/xio/util.go new file mode 100644 index 0000000..554317b --- /dev/null +++ b/skate/xio/util.go @@ -0,0 +1,14 @@ +package xio + +import "os" + +// OpenTwo opens two files, and the caller needs to check for a single error only. +func OpenTwo(f1, f2 string) (g1 *os.File, g2 *os.File, err error) { + if g1, err = os.Open(f1); err != nil { + return nil, nil, err + } + if g2, err = os.Open(f2); err != nil { + return nil, nil, err + } + return g1, g2, nil +} |