37 lines
616 B
Go
37 lines
616 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
)
|
|
|
|
func main() {
|
|
if len(os.Args) < 2 {
|
|
panic("Provide input file")
|
|
}
|
|
inputFile := os.Args[1]
|
|
|
|
part1, part2 := solution(inputFile)
|
|
fmt.Printf("(%s) Part 1: %d\n(%s) Part 2: %d\n", inputFile, part1, inputFile, part2)
|
|
}
|
|
|
|
func solution(inputFile string) (int, int) {
|
|
var part1, part2 int
|
|
|
|
// Read line by line
|
|
// input, err := os.Open(inputFile)
|
|
// if err != nil {
|
|
// panic(err)
|
|
// }
|
|
// defer input.Close()
|
|
|
|
// read whole file
|
|
// input, err := os.ReadFile(inputFile)
|
|
// if err != nil {
|
|
// panic(err)
|
|
// }
|
|
// fmt.Println(string(input))
|
|
|
|
return part1, part2
|
|
}
|