Skip to content

Commit

Permalink
restructure go
Browse files Browse the repository at this point in the history
  • Loading branch information
TimHi committed Oct 19, 2023
1 parent 66f030f commit 97ac006
Show file tree
Hide file tree
Showing 95 changed files with 50 additions and 45 deletions.
Binary file modified .DS_Store
Binary file not shown.
3 changes: 1 addition & 2 deletions .github/workflows/2022.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ on: [push]

jobs:
build:

runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand All @@ -15,5 +14,5 @@ jobs:
go-version: 1.19

- name: Test
working-directory: ./2022
working-directory: ./Go
run: go test -v ./...
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"runtime"
"testing"

"github.com/TimHi/AdventOfCode/m/v2/cmd/day01"
"github.com/TimHi/AdventOfCode/m/v2/cmd/2022/day01"
"github.com/TimHi/AdventOfCode/m/v2/pkg/fileutil"
"github.com/TimHi/AdventOfCode/m/v2/pkg/pairs"
"github.com/stretchr/testify/assert"
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"runtime"
"testing"

"github.com/TimHi/AdventOfCode/m/v2/cmd/day02"
"github.com/TimHi/AdventOfCode/m/v2/cmd/2022/day02"
"github.com/TimHi/AdventOfCode/m/v2/pkg/fileutil"
"github.com/stretchr/testify/assert"
)
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"runtime"
"testing"

"github.com/TimHi/AdventOfCode/m/v2/cmd/day03"
"github.com/TimHi/AdventOfCode/m/v2/cmd/2022/day03"
"github.com/TimHi/AdventOfCode/m/v2/pkg/fileutil"
"github.com/stretchr/testify/assert"
)
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"runtime"
"testing"

"github.com/TimHi/AdventOfCode/m/v2/cmd/day04"
"github.com/TimHi/AdventOfCode/m/v2/cmd/2022/day04"
"github.com/TimHi/AdventOfCode/m/v2/pkg/fileutil"
"github.com/stretchr/testify/assert"
)
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ import (
"runtime"
"testing"

"github.com/TimHi/AdventOfCode/m/v2/cmd/day05"

"github.com/TimHi/AdventOfCode/m/v2/cmd/2022/day05"
"github.com/TimHi/AdventOfCode/m/v2/pkg/fileutil"
"github.com/stretchr/testify/assert"
)
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ import (
"runtime"
"testing"

"github.com/TimHi/AdventOfCode/m/v2/cmd/day06"

"github.com/TimHi/AdventOfCode/m/v2/cmd/2022/day06"
"github.com/TimHi/AdventOfCode/m/v2/pkg/fileutil"
"github.com/stretchr/testify/assert"
)
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"runtime"
"testing"

"github.com/TimHi/AdventOfCode/m/v2/cmd/day07"
"github.com/TimHi/AdventOfCode/m/v2/cmd/2022/day07"
"github.com/TimHi/AdventOfCode/m/v2/pkg/fileutil"
"github.com/stretchr/testify/assert"
)
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"runtime"
"testing"

"github.com/TimHi/AdventOfCode/m/v2/cmd/day08"
"github.com/TimHi/AdventOfCode/m/v2/cmd/2022/day08"
"github.com/TimHi/AdventOfCode/m/v2/pkg/fileutil"
"github.com/stretchr/testify/assert"
)
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"runtime"
"testing"

"github.com/TimHi/AdventOfCode/m/v2/cmd/day09"
"github.com/TimHi/AdventOfCode/m/v2/cmd/2022/day09"
"github.com/TimHi/AdventOfCode/m/v2/pkg/fileutil"
"github.com/stretchr/testify/assert"
)
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"runtime"
"testing"

"github.com/TimHi/AdventOfCode/m/v2/cmd/day11"
"github.com/TimHi/AdventOfCode/m/v2/cmd/2022/day11"
"github.com/TimHi/AdventOfCode/m/v2/pkg/fileutil"
"github.com/stretchr/testify/assert"
)
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"runtime"
"testing"

"github.com/TimHi/AdventOfCode/m/v2/cmd/day12"
"github.com/TimHi/AdventOfCode/m/v2/cmd/2022/day12"
"github.com/TimHi/AdventOfCode/m/v2/pkg/fileutil"
"github.com/stretchr/testify/assert"
)
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"runtime"
"testing"

"github.com/TimHi/AdventOfCode/m/v2/cmd/day13"
"github.com/TimHi/AdventOfCode/m/v2/cmd/2022/day13"
"github.com/TimHi/AdventOfCode/m/v2/pkg/fileutil"
)

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"runtime"
"testing"

"github.com/TimHi/AdventOfCode/m/v2/cmd/day14"
"github.com/TimHi/AdventOfCode/m/v2/cmd/2022/day14"
"github.com/TimHi/AdventOfCode/m/v2/pkg/fileutil"
"github.com/stretchr/testify/assert"
)
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"runtime"
"testing"

"github.com/TimHi/AdventOfCode/m/v2/cmd/day15"
"github.com/TimHi/AdventOfCode/m/v2/cmd/2022/day15"
"github.com/TimHi/AdventOfCode/m/v2/pkg/fileutil"
"github.com/stretchr/testify/assert"
)
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"runtime"
"testing"

"github.com/TimHi/AdventOfCode/m/v2/cmd/day16"
"github.com/TimHi/AdventOfCode/m/v2/cmd/2022/day16"
"github.com/TimHi/AdventOfCode/m/v2/pkg/fileutil"
"github.com/stretchr/testify/assert"
)
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"runtime"
"testing"

"github.com/TimHi/AdventOfCode/m/v2/cmd/day17"
"github.com/TimHi/AdventOfCode/m/v2/cmd/2022/day17"
"github.com/TimHi/AdventOfCode/m/v2/pkg/fileutil"
"github.com/stretchr/testify/assert"
)
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"runtime"
"testing"

"github.com/TimHi/AdventOfCode/m/v2/cmd/day18"
"github.com/TimHi/AdventOfCode/m/v2/cmd/2022/day18"
"github.com/TimHi/AdventOfCode/m/v2/pkg/fileutil"
"github.com/stretchr/testify/assert"
)
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"runtime"
"testing"

"github.com/TimHi/AdventOfCode/m/v2/cmd/day19"
"github.com/TimHi/AdventOfCode/m/v2/cmd/2022/day19"
"github.com/TimHi/AdventOfCode/m/v2/pkg/fileutil"
)

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"runtime"
"testing"

"github.com/TimHi/AdventOfCode/m/v2/cmd/day20"
"github.com/TimHi/AdventOfCode/m/v2/cmd/2022/day20"
"github.com/TimHi/AdventOfCode/m/v2/pkg/fileutil"
"github.com/stretchr/testify/assert"
)
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"runtime"
"testing"

"github.com/TimHi/AdventOfCode/m/v2/cmd/day21"
"github.com/TimHi/AdventOfCode/m/v2/cmd/2022/day21"
"github.com/TimHi/AdventOfCode/m/v2/pkg/fileutil"
"github.com/stretchr/testify/assert"
)
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
50 changes: 29 additions & 21 deletions Go/2022/main.go → Go/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,39 +5,47 @@ import (
"log"
"time"

"github.com/TimHi/AdventOfCode/m/v2/cmd/day01"
"github.com/TimHi/AdventOfCode/m/v2/cmd/day02"
"github.com/TimHi/AdventOfCode/m/v2/cmd/day03"
"github.com/TimHi/AdventOfCode/m/v2/cmd/day04"
"github.com/TimHi/AdventOfCode/m/v2/cmd/day05"
"github.com/TimHi/AdventOfCode/m/v2/cmd/day06"
"github.com/TimHi/AdventOfCode/m/v2/cmd/day07"
"github.com/TimHi/AdventOfCode/m/v2/cmd/day08"
"github.com/TimHi/AdventOfCode/m/v2/cmd/day09"
"github.com/TimHi/AdventOfCode/m/v2/cmd/day10"
"github.com/TimHi/AdventOfCode/m/v2/cmd/day11"
"github.com/TimHi/AdventOfCode/m/v2/cmd/day12"
"github.com/TimHi/AdventOfCode/m/v2/cmd/day13"
"github.com/TimHi/AdventOfCode/m/v2/cmd/day14"
"github.com/TimHi/AdventOfCode/m/v2/cmd/day15"
"github.com/TimHi/AdventOfCode/m/v2/cmd/day16"
"github.com/TimHi/AdventOfCode/m/v2/cmd/day17"
"github.com/TimHi/AdventOfCode/m/v2/cmd/day18"
"github.com/TimHi/AdventOfCode/m/v2/cmd/day19"
"github.com/TimHi/AdventOfCode/m/v2/cmd/day20"
"github.com/TimHi/AdventOfCode/m/v2/cmd/day21"
"github.com/TimHi/AdventOfCode/m/v2/cmd/2022/day01"
"github.com/TimHi/AdventOfCode/m/v2/cmd/2022/day02"
"github.com/TimHi/AdventOfCode/m/v2/cmd/2022/day03"
"github.com/TimHi/AdventOfCode/m/v2/cmd/2022/day04"
"github.com/TimHi/AdventOfCode/m/v2/cmd/2022/day05"
"github.com/TimHi/AdventOfCode/m/v2/cmd/2022/day06"
"github.com/TimHi/AdventOfCode/m/v2/cmd/2022/day07"
"github.com/TimHi/AdventOfCode/m/v2/cmd/2022/day08"
"github.com/TimHi/AdventOfCode/m/v2/cmd/2022/day09"
"github.com/TimHi/AdventOfCode/m/v2/cmd/2022/day10"
"github.com/TimHi/AdventOfCode/m/v2/cmd/2022/day11"
"github.com/TimHi/AdventOfCode/m/v2/cmd/2022/day12"
"github.com/TimHi/AdventOfCode/m/v2/cmd/2022/day13"
"github.com/TimHi/AdventOfCode/m/v2/cmd/2022/day14"
"github.com/TimHi/AdventOfCode/m/v2/cmd/2022/day15"
"github.com/TimHi/AdventOfCode/m/v2/cmd/2022/day16"
"github.com/TimHi/AdventOfCode/m/v2/cmd/2022/day17"
"github.com/TimHi/AdventOfCode/m/v2/cmd/2022/day18"
"github.com/TimHi/AdventOfCode/m/v2/cmd/2022/day19"
"github.com/TimHi/AdventOfCode/m/v2/cmd/2022/day20"
"github.com/TimHi/AdventOfCode/m/v2/cmd/2022/day21"
)

var dayFlag int
var yearFlag int
var useSampleFlag bool

func init() {
flag.IntVar(&yearFlag, "year", -1, "Specify the year you want to solve")
flag.IntVar(&dayFlag, "day", -1, "Specify the day you want to solve")
flag.BoolVar(&useSampleFlag, "sample", true, "Specify wether you want to use sample [true] or the full [false] input")
}

func main() {
flag.Parse()
if yearFlag == 2022 {
run2022()
}
}

func run2022() {
start := time.Now()
switch dayFlag {
case 1:
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 97ac006

Please sign in to comment.