Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ on:

jobs:
linting:
needs: testing
strategy:
fail-fast: false
max-parallel: 2
Expand Down Expand Up @@ -56,6 +57,7 @@ jobs:
make lint-pipeline

reports:
needs: linting
strategy:
fail-fast: true
max-parallel: 1
Expand Down Expand Up @@ -130,6 +132,7 @@ jobs:


build:
needs: linting
strategy:
fail-fast: false
max-parallel: 2
Expand Down
4 changes: 4 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ builds:
- -trimpath
ldflags:
- "{{ .Env.GO_BUILD_LDFLAGS }}"
-
universal_binaries:
- id: cli
replace: true

archives:
- id: cli
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ This repository contains solutions for puzzles and cli tool to run solutions to
<details>
<summary>2018</summary>

- [ ] [Day 1: Chronal Calibration](https://adventofcode.com/2018/day/1)
- [x] [Day 1: Chronal Calibration](https://adventofcode.com/2018/day/1)
- [ ] [Day 2: Inventory Management System](https://adventofcode.com/2018/day/2)
- [ ] [Day 3: No Matter How You Slice It](https://adventofcode.com/2018/day/3)
- [ ] [Day 4: Repose Record](https://adventofcode.com/2018/day/4)
Expand Down
21 changes: 0 additions & 21 deletions cmd/aoc-cli/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ package main
import (
"bytes"
"context"
"encoding/json"
"errors"
"fmt"
"os"
Expand Down Expand Up @@ -169,26 +168,6 @@ func handlePuzzleChoices(ctx context.Context, year string, opt promptui.Select)
}
}

// PrettyPrint appends to passed struct indents and returns a human-readable form of struct.
// Each element of JSON object will start from indent with prefix.
func PrettyPrint(v interface{}, prefix string, indent string) (string, error) {
b, err := json.Marshal(v)
if err != nil {
return "", fmt.Errorf("failed to marshal: %w", err)
}

var out bytes.Buffer
if err := json.Indent(&out, b, prefix, indent); err != nil {
return "", fmt.Errorf("failed to indent: %w", err)
}

if _, err := out.WriteString("\n"); err != nil {
return "", fmt.Errorf("failed to write string: %w", err)
}

return out.String(), nil
}

func isExit(input string) bool {
return strings.EqualFold(exit, input)
}
Expand Down
Loading