Skip to content
This repository has been archived by the owner on Jun 21, 2023. It is now read-only.

Commit

Permalink
Add lint test and make it pass.
Browse files Browse the repository at this point in the history
  • Loading branch information
karlkfi committed Aug 18, 2020
1 parent 4e1c0c9 commit 3e82f4e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/e2e-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ on:
- master

jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Lint Go Code
run: make lint
e2e-test:
runs-on: ubuntu-latest
steps:
Expand Down
9 changes: 5 additions & 4 deletions pkg/tombstone/tombstone.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ type Tombstone struct {
Graveyard string `json:"-"`
Name string `json:"-"`

fileLock sync.Mutex `json:"-"`
fileLock sync.Mutex
}

func (t *Tombstone) Path() string {
Expand Down Expand Up @@ -64,7 +64,7 @@ func (t *Tombstone) RecordBirth() error {
log.Printf("Creating tombstone: %s\n", t.Path())
err := t.Write()
if err != nil {
return fmt.Errorf("failed to create tombstone: ", err)
return fmt.Errorf("failed to create tombstone: %v", err)
}
return nil
}
Expand All @@ -78,15 +78,16 @@ func (t *Tombstone) RecordDeath(exitCode int) error {
log.Printf("Updating tombstone: %s\n", t.Path())
err := t.Write()
if err != nil {
return fmt.Errorf("failed to update tombstone: ", err)
return fmt.Errorf("failed to update tombstone: %v", err)
}
return nil
}

func (t *Tombstone) String() string {
inline, err := json.Marshal(t)
if err != nil {
return fmt.Sprintf("%+v", t)
log.Printf("Error: failed to marshal tombstone as json: %v\n", err)
return "{}"
}
return string(inline)
}
Expand Down

0 comments on commit 3e82f4e

Please sign in to comment.