Skip to content

Commit 4bf3716

Browse files
committed
Refactor project structure
1 parent bf40213 commit 4bf3716

File tree

6 files changed

+8
-8
lines changed

6 files changed

+8
-8
lines changed

cmd/main.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ import (
1010

1111
"github.com/pkg/errors"
1212

13-
"github.com/oleg-balunenko/advent-of-code/internal/puzzle"
14-
_ "github.com/oleg-balunenko/advent-of-code/internal/solutions/day01"
13+
"github.com/oleg-balunenko/advent-of-code/puzzles"
14+
_ "github.com/oleg-balunenko/advent-of-code/puzzles/solutions/day01"
1515
)
1616

1717
var (
@@ -30,7 +30,7 @@ func main() {
3030
func menu() {
3131
fmt.Println("Menu:")
3232

33-
solvers := puzzle.Solvers()
33+
solvers := puzzles.Solvers()
3434

3535
var choices = make(map[string]string, len(solvers))
3636

@@ -57,14 +57,14 @@ func menu() {
5757
}
5858

5959
func run(name string) {
60-
s, err := puzzle.GetSolver(name)
60+
s, err := puzzles.GetSolver(name)
6161
if err != nil {
6262
log.Fatal(errors.Wrap(err, "failed to get solver"))
6363
}
6464

6565
input := filepath.Join(*inputDir, fmt.Sprintf("%s.txt", name))
6666

67-
if err := puzzle.Run(s, input); err != nil {
67+
if err := puzzles.Run(s, input); err != nil {
6868
log.Fatal(errors.Wrap(err, "failed to run puzzle solver"))
6969
}
7070
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77

88
"github.com/pkg/errors"
99

10-
"github.com/oleg-balunenko/advent-of-code/internal/puzzle"
10+
"github.com/oleg-balunenko/advent-of-code/puzzles"
1111
)
1212

1313
type solver struct {
@@ -17,7 +17,7 @@ type solver struct {
1717
func init() {
1818
const puzzleName = "day01"
1919

20-
puzzle.Register(puzzleName, solver{
20+
puzzles.Register(puzzleName, solver{
2121
name: puzzleName,
2222
})
2323
}
File renamed without changes.
File renamed without changes.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package puzzle
1+
package puzzles
22

33
import (
44
"bytes"

0 commit comments

Comments
 (0)