aboutsummaryrefslogtreecommitdiffstats
path: root/skate/xio/util.go
blob: 554317be9305146b5fd6b20dd265da5e8f6c58eb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
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
}