Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AtoiOrBust ¶
AtoiOrBust converts a string to an integer, or it panics
func FileInts ¶
FileInts reads all the lines of a file, parses them into ints and returns them as a slice
func PrintDuration ¶
PrintDuration prints the time since t. Call this function like this and it will print the run time of a function after it ends:
defer aoc.PrintDuration(time.Now())
This works because when you use 'defer' the arguments of a function will be evaluated immediately, while the function itself will only be evaluated after the parent function ends.
Types ¶
type ScannerCloser ¶
ScannerCloser is a scanner with a Close method to close the underlying file
func FileScanner ¶
func FileScanner(p string) ScannerCloser
FileScanner opens a file and wraps it in a scanner. Close the file after you are done with the returned io.Closer
Click to show internal directories.
Click to hide internal directories.