Skip to content

Commit e68f862

Browse files
committed
move scaffold out
1 parent 79682fc commit e68f862

File tree

5 files changed

+31
-25
lines changed

5 files changed

+31
-25
lines changed

README.md

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Opinionated Advent of Code Shared Library
2+
3+
* [Client](./client)
4+
* [Scaffolding](./scaffold)

client/README.md

+1-25
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
>
1010
> Source: adventofcode.com
1111
12+
## Download input file
1213
```go
1314
targetDir := fmt.Sprintf("input/day%02d", dayNumber)
1415
targetFile := fmt.Sprintf("%s/input", targetDir)
@@ -43,28 +44,3 @@ if valid {
4344
fmt.Println("Something is wrong :(")
4445
}
4546
```
46-
47-
## Generate file/directory structure from template
48-
49-
Note: All file will be rendered with `.tmpl` extension
50-
and all directory will be created where there is at least
51-
one `.tmpl` file.
52-
53-
```go
54-
type templateVariables struct {
55-
Day int
56-
Root string
57-
}
58-
59-
err := aoc.Scaffold(
60-
templateDir,
61-
fmt.Sprintf("days/day%02d", dayNumber),
62-
templateVariables{
63-
Day: dayNumber,
64-
Root: packageRoot,
65-
},
66-
)
67-
if err != nil {
68-
logrus.Errorln(err)
69-
}
70-
```

scaffold/README.md

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Scaffolding
2+
3+
## Generate file/directory structure from template
4+
5+
Note: All file will be rendered with `.tmpl` extension
6+
and all directory will be created where there is at least
7+
one `.tmpl` file.
8+
9+
```go
10+
type templateVariables struct {
11+
Day int
12+
Root string
13+
}
14+
15+
err := aoc.Scaffold(
16+
templateDir,
17+
fmt.Sprintf("days/day%02d", dayNumber),
18+
templateVariables{
19+
Day: dayNumber,
20+
Root: packageRoot,
21+
},
22+
)
23+
if err != nil {
24+
logrus.Errorln(err)
25+
}
26+
```

client/io.go scaffold/io.go

File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)