aboutsummaryrefslogtreecommitdiffstats
path: root/skate/xio
diff options
context:
space:
mode:
authorMartin Czygan <martin.czygan@gmail.com>2021-05-06 19:47:35 +0200
committerMartin Czygan <martin.czygan@gmail.com>2021-05-06 19:47:35 +0200
commitb46c9d351aa0a2a5c3618a1420259d4605a9654e (patch)
tree376f55f59baf657397210b2a2a3724b9ba61f6bb /skate/xio
parentfb627564751d170c55b45785da569268b6290be9 (diff)
downloadrefcat-b46c9d351aa0a2a5c3618a1420259d4605a9654e.tar.gz
refcat-b46c9d351aa0a2a5c3618a1420259d4605a9654e.zip
move skate-verify to skate-reduce
Diffstat (limited to 'skate/xio')
-rw-r--r--skate/xio/util.go14
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
+}