Day 5, part 1.
This commit is contained in:
@ -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")
|
||||
}
|
||||
|
Reference in New Issue
Block a user