Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added lint job #30

Closed
wants to merge 6 commits into from
Closed
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
5 changes: 5 additions & 0 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ jobs:
- name: Check out code into the Go module directory
uses: actions/checkout@v2

- name: Lint code
uses: golangci/golangci-lint-action@v2
with:
version: v4.0.0

- name: Get dependencies
run: go mod download

Expand Down
6 changes: 2 additions & 4 deletions zfs/Snapshot.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,8 @@ type (
}
)

var (
// ErrMalformedLine will be returned if output from zfs is unusable.
ErrMalformedLine = errors.New("broken line")
)
// ErrMalformedLine will be returned if output from zfs is unusable.
var ErrMalformedLine = errors.New("broken line")

// NewSnapshotFromLine will try to parse a line from "zfs list" and instantiate
// a new Snapshot.
Expand Down
15 changes: 10 additions & 5 deletions zfs/SnapshotList_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -265,27 +265,32 @@ func TestSieve(t *testing.T) {
true, true, true, true, true,
true, true, true, true, true,
false, true, true, true, true,
true, true}},
true, true,
}},
{time.Unix(0, 0), 5 * time.Second, []bool{
true, true, true, true, true,
false, true, true, true, false,
false, true, true, false, true,
true, true}},
true, true,
}},
{time.Unix(0, 0), 10 * time.Second, []bool{
true, false, true, false, true,
false, false, true, false, false,
false, true, false, false, true,
false, true}},
false, true,
}},
{time.Unix(0, 0), 100 * time.Second, []bool{
true, false, false, false, false,
false, false, false, false, false,
false, false, false, false, false,
false, false}},
false, false,
}},
{time.Unix(0, 0), 100000000 * time.Second, []bool{
true, false, false, false, false,
false, false, false, false, false,
false, false, false, false, false,
false, false}},
false, false,
}},
}

for i, c := range cases {
Expand Down
Loading