~smlavine/mazesolver

6e8284a0a35b34d35b09f96c2209c07f8666538b — Sebastian LaVine 2 years ago 3f7d764
Fix undefined in, out, err
1 files changed, 6 insertions(+), 0 deletions(-)

M mazesolver.go
M mazesolver.go => mazesolver.go +6 -0
@@ 130,9 130,14 @@ func main() {

	flag.Parse()

	var (
		in  io.Reader
		out io.Writer
	)
	if infile == "" {
		in = os.Stdin
	} else {
		var err error
		in, err = os.Open(infile)
		if err != nil {
			log.Fatalf("failed to open '%s': %v\n", infile, err)


@@ 143,6 148,7 @@ func main() {
	if outfile == "" {
		out = os.Stdout
	} else {
		var err error
		out, err = os.Create(outfile)
		if err != nil {
			log.Fatalf("failed to open '%s': %v\n", outfile, err)