Skip to content

Commit db4ebc5

Browse files
authored
Merge pull request #33 from obalunenko/2018/day01
feat(puzzles): Initial commit for 2018/day01
2 parents 6974b7a + eee56b4 commit db4ebc5

File tree

9 files changed

+1516
-22
lines changed

9 files changed

+1516
-22
lines changed

.github/workflows/go.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ on:
2121

2222
jobs:
2323
linting:
24+
needs: testing
2425
strategy:
2526
fail-fast: false
2627
max-parallel: 2
@@ -56,6 +57,7 @@ jobs:
5657
make lint-pipeline
5758
5859
reports:
60+
needs: linting
5961
strategy:
6062
fail-fast: true
6163
max-parallel: 1
@@ -130,6 +132,7 @@ jobs:
130132
131133
132134
build:
135+
needs: linting
133136
strategy:
134137
fail-fast: false
135138
max-parallel: 2

.goreleaser.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@ builds:
4040
- -trimpath
4141
ldflags:
4242
- "{{ .Env.GO_BUILD_LDFLAGS }}"
43+
-
44+
universal_binaries:
45+
- id: cli
46+
replace: true
4347

4448
archives:
4549
- id: cli

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ This repository contains solutions for puzzles and cli tool to run solutions to
121121
<details>
122122
<summary>2018</summary>
123123

124-
- [ ] [Day 1: Chronal Calibration](https://adventofcode.com/2018/day/1)
124+
- [x] [Day 1: Chronal Calibration](https://adventofcode.com/2018/day/1)
125125
- [ ] [Day 2: Inventory Management System](https://adventofcode.com/2018/day/2)
126126
- [ ] [Day 3: No Matter How You Slice It](https://adventofcode.com/2018/day/3)
127127
- [ ] [Day 4: Repose Record](https://adventofcode.com/2018/day/4)

cmd/aoc-cli/main.go

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ package main
44
import (
55
"bytes"
66
"context"
7-
"encoding/json"
87
"errors"
98
"fmt"
109
"os"
@@ -169,26 +168,6 @@ func handlePuzzleChoices(ctx context.Context, year string, opt promptui.Select)
169168
}
170169
}
171170

172-
// PrettyPrint appends to passed struct indents and returns a human-readable form of struct.
173-
// Each element of JSON object will start from indent with prefix.
174-
func PrettyPrint(v interface{}, prefix string, indent string) (string, error) {
175-
b, err := json.Marshal(v)
176-
if err != nil {
177-
return "", fmt.Errorf("failed to marshal: %w", err)
178-
}
179-
180-
var out bytes.Buffer
181-
if err := json.Indent(&out, b, prefix, indent); err != nil {
182-
return "", fmt.Errorf("failed to indent: %w", err)
183-
}
184-
185-
if _, err := out.WriteString("\n"); err != nil {
186-
return "", fmt.Errorf("failed to write string: %w", err)
187-
}
188-
189-
return out.String(), nil
190-
}
191-
192171
func isExit(input string) bool {
193172
return strings.EqualFold(exit, input)
194173
}

0 commit comments

Comments
 (0)