mirror of
https://github.com/onyx-and-iris/aoc2024.git
synced 2025-01-10 06:40:47 +00:00
move flag parsing into /cmd/cli/main.go
solves issue redefined flag when running benchmarks
This commit is contained in:
parent
588561be7c
commit
d05828154e
29
day-01/cmd/cli/main.go
Normal file
29
day-01/cmd/cli/main.go
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
/********************************************************************************
|
||||||
|
Advent of Code 2024 - day-01
|
||||||
|
********************************************************************************/
|
||||||
|
|
||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"embed"
|
||||||
|
"flag"
|
||||||
|
"fmt"
|
||||||
|
"log"
|
||||||
|
|
||||||
|
problems "github.com/onyx-and-iris/aoc2024/day-01"
|
||||||
|
)
|
||||||
|
|
||||||
|
//go:embed testdata
|
||||||
|
var files embed.FS
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
filename := flag.String("f", "input.txt", "input file")
|
||||||
|
flag.Parse()
|
||||||
|
|
||||||
|
data, err := files.ReadFile(fmt.Sprintf("testdata/%s", *filename))
|
||||||
|
if err != nil {
|
||||||
|
log.Fatal(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
problems.Solve(data)
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user