Day 5, part 1.
This commit is contained in:
parent
1615406a28
commit
f2e2797587
2 changed files with 63 additions and 0 deletions
|
@ -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")
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue