advent-of-code/2023/day-1/main.go
Dan Anglin 76583b3dda
All checks were successful
/ test (pull_request) Successful in 25s
refactor: add common functions to internal package
It's time to add common functions to the internal 'common' package.

- Add the function that read the contents from a file to a list.
- Add the function that parses a list of integers from a string.

...and more to come later...
2023-12-05 19:43:52 +00:00

18 lines
500 B
Go

package main
import (
"fmt"
"log"
"codeflow.dananglin.me.uk/apollo/advent-of-code/internal/common"
)
func main() {
document, err := common.ReadFile("2023/day-1/files/input")
if err != nil {
log.Fatalf("Error: Unable to retrieve the calibration document; %v", err)
}
fmt.Printf("[Part 1] Total sum of calibration values: %d\n", partOneCalculateSumCalibrationValues(document))
fmt.Printf("[Part 2] Total sum of calibration values: %d\n", partTwoCalculateSumCalibrationValues(document))
}