Day 11 solution.
This commit is contained in:
parent
a83dccd53b
commit
43f0edf0fb
2 changed files with 139 additions and 0 deletions
|
@ -2,6 +2,7 @@ package fileutils
|
|||
|
||||
import (
|
||||
"bufio"
|
||||
"bytes"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
"os"
|
||||
|
@ -58,3 +59,12 @@ func InputParserStrings(filename string) []string {
|
|||
}
|
||||
return strings.Split(string(data), "\n")
|
||||
}
|
||||
|
||||
func InputParserBytes(filename string) [][]byte {
|
||||
data, err := ioutil.ReadFile(filename)
|
||||
if err != nil {
|
||||
log.Panicf(err.Error())
|
||||
}
|
||||
output := bytes.Split(data, []byte("\n"))
|
||||
return output[:len(output)-1]
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue