Day 5, part 1.

This commit is contained in:
2018-12-05 03:49:03 -05:00
parent 1615406a28
commit f2e2797587
2 changed files with 63 additions and 0 deletions

View File

@ -2,6 +2,8 @@ package util
import (
"bufio"
"bytes"
"io/ioutil"
"os"
)
@ -22,3 +24,14 @@ func ReadInput() []string {
return lines
}
// ReadInputS is like ReadInput, but returns a byte array.
func ReadInputBytes() []byte {
rawData, err := ioutil.ReadFile(os.Args[1])
if err != nil {
panic(err)
}
return bytes.TrimRight(rawData, "\n")
}