From dc05cd00f257cb62ace99b187357febe63167bd3 Mon Sep 17 00:00:00 2001 From: Christian Schwarz Date: Sat, 2 Nov 2024 15:45:09 +0100 Subject: [PATCH] lint: add lint checking for time.Equal (#841) No issues found, tested that the lint works by changing code locally. fixes https://github.com/zrepl/zrepl/issues/5 --- .golangci.yml | 5 +++++ internal/zfs/versions.go | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.golangci.yml b/.golangci.yml index bc1cdcd..4246ead 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,7 +1,12 @@ linters: enable: - goimports + - revive +linters-settings: + revive: + rules: + - name: time-equal issues: exclude-rules: - path: _test\.go diff --git a/internal/zfs/versions.go b/internal/zfs/versions.go index c7f43ec..f8885d3 100644 --- a/internal/zfs/versions.go +++ b/internal/zfs/versions.go @@ -122,7 +122,7 @@ func (v FilesystemVersion) String() string { return v.RelName() } // are immutable over time in ZFS. func FilesystemVersionEqualIdentity(a, b FilesystemVersion) bool { // .Name is mutable - return a.Guid == b.Guid && a.CreateTXG == b.CreateTXG && a.Creation == b.Creation + return a.Guid == b.Guid && a.CreateTXG == b.CreateTXG && a.Creation.Equal(b.Creation) } func (v FilesystemVersion) ToAbsPath(p *DatasetPath) string {