From b46c9d351aa0a2a5c3618a1420259d4605a9654e Mon Sep 17 00:00:00 2001 From: Martin Czygan Date: Thu, 6 May 2021 19:47:35 +0200 Subject: move skate-verify to skate-reduce --- skate/xio/util.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 skate/xio/util.go (limited to 'skate/xio/util.go') 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 +} -- cgit v1.2.3