File tree Expand file tree Collapse file tree 3 files changed +25
-9
lines changed
internal/puzzles/solutions Expand file tree Collapse file tree 3 files changed +25
-9
lines changed Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ import (
1212
1313func createNewFromTemplate (purl string ) error {
1414 const (
15- perms = 0o655
15+ perms = os . ModePerm
1616 yearLen = 4
1717 dayLen = 2
1818 )
@@ -38,10 +38,13 @@ func createNewFromTemplate(purl string) error {
3838 }
3939
4040 params := templates.Params {
41- Year : year ,
42- Day : pd .day ,
43- DayStr : day ,
44- URL : purl ,
41+ Year : year ,
42+ Day : pd .day ,
43+ DayStr : day ,
44+ URL : purl ,
45+ Title : "<!--- Pass here the title --->" ,
46+ DescriptionPartOne : "<!--- Pass here the description for part one --->" ,
47+ DescriptionPartTwo : "<!--- Pass here the description for part two --->" ,
4548 }
4649
4750 path := filepath .Clean (filepath .Join (year , "day" + day ))
Original file line number Diff line number Diff line change @@ -19,10 +19,13 @@ var (
1919
2020// Params contains parameters for templates.
2121type Params struct {
22- Year string // e.g. "2023"
23- Day int // e.g. 2
24- DayStr string // e.g. "02"
25- URL string // e.g. "https://adventofcode.com/2023/day/2"
22+ Year string // e.g. "2023"
23+ Day int // e.g. 2
24+ DayStr string // e.g. "02"
25+ URL string // e.g. "https://adventofcode.com/2023/day/2"
26+ Title string // For now it's empty.
27+ DescriptionPartOne string // For now it's empty.
28+ DescriptionPartTwo string // For now it's empty.
2629}
2730
2831// SolutionTmpl returns template for solution.go file.
Original file line number Diff line number Diff line change 1+ # Puzzle {{ .URL }}
12
3+ # --- Day {{ .Day }}: {{ .Title }} ---
4+
5+ ## --- Part One ---
6+
7+ {{ .DescriptionPartOne }}
8+
9+ ## --- Part Two ---
10+
11+ {{ .DescriptionPartTwo }}
212
You can’t perform that action at this time.
0 commit comments