Add load function to setup
Signed-off-by: James Griffin <james@unsupervised.ca>
This commit is contained in:
22
setup.sh
22
setup.sh
@@ -2,7 +2,27 @@
|
||||
|
||||
mkdir $1
|
||||
|
||||
echo "package $1" >> $1/day_$1.go
|
||||
echo "package seventeen
|
||||
|
||||
import (
|
||||
\"bufio\"
|
||||
\"os\"
|
||||
)
|
||||
|
||||
func load(filename string) error {
|
||||
file, err := os.Open(filename)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer file.Close()
|
||||
|
||||
scanner := bufio.NewScanner(file)
|
||||
for scanner.Scan() {
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
" >> $1/day_$1.go
|
||||
echo "package $1" >> $1/day_$1_test.go
|
||||
touch $1/sample.txt
|
||||
touch $1/input.txt
|
Reference in New Issue
Block a user