summaryrefslogtreecommitdiff
path: root/lib/btrfs/btrfsitem
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@lukeshu.com>2023-01-01 22:43:58 -0700
committerLuke Shumaker <lukeshu@lukeshu.com>2023-01-01 22:43:58 -0700
commitd675f41242c043ddc4c6c1a1fb8aabcfd324aae2 (patch)
tree4f2afbce761eb377ad0b0ab2e4fb2f478ff844f5 /lib/btrfs/btrfsitem
parent9971e38110d5f90d15c7b78f396f2638b3952a96 (diff)
parent6e1a9fbb1e9a943e04902ed3a4958f6821e39456 (diff)
Merge branch 'lukeshu/lint'
Diffstat (limited to 'lib/btrfs/btrfsitem')
-rw-r--r--lib/btrfs/btrfsitem/item_uuid.go4
-rw-r--r--lib/btrfs/btrfsitem/items.go4
-rw-r--r--lib/btrfs/btrfsitem/statmode.go4
3 files changed, 6 insertions, 6 deletions
diff --git a/lib/btrfs/btrfsitem/item_uuid.go b/lib/btrfs/btrfsitem/item_uuid.go
index e1a6cf9..5f5f357 100644
--- a/lib/btrfs/btrfsitem/item_uuid.go
+++ b/lib/btrfs/btrfsitem/item_uuid.go
@@ -1,4 +1,4 @@
-// Copyright (C) 2022 Luke Shumaker <lukeshu@lukeshu.com>
+// Copyright (C) 2022-2023 Luke Shumaker <lukeshu@lukeshu.com>
//
// SPDX-License-Identifier: GPL-2.0-or-later
@@ -12,7 +12,7 @@ import (
)
// The Key for this item is a UUID, and the item is a subvolume IDs
-// that that UUID maps to.
+// that UUID maps to.
//
// key.objectid = first half of UUID
// key.offset = second half of UUID
diff --git a/lib/btrfs/btrfsitem/items.go b/lib/btrfs/btrfsitem/items.go
index 29b3cb0..67f96fa 100644
--- a/lib/btrfs/btrfsitem/items.go
+++ b/lib/btrfs/btrfsitem/items.go
@@ -1,4 +1,4 @@
-// Copyright (C) 2022 Luke Shumaker <lukeshu@lukeshu.com>
+// Copyright (C) 2022-2023 Luke Shumaker <lukeshu@lukeshu.com>
//
// SPDX-License-Identifier: GPL-2.0-or-later
@@ -70,7 +70,6 @@ func UnmarshalItem(key btrfsprim.Key, csumType btrfssum.CSumType, dat []byte) It
Dat: dat,
Err: fmt.Errorf("btrfsitem.UnmarshalItem({ItemType:%v}, dat): %w", key.ItemType, err),
}
-
}
if n < len(dat) {
return Error{
@@ -79,5 +78,6 @@ func UnmarshalItem(key btrfsprim.Key, csumType btrfssum.CSumType, dat []byte) It
key.ItemType, len(dat), n),
}
}
+ //nolint:forcetypeassert // items_gen.go has all types in keytype2gotype implement the Item interface.
return retPtr.Elem().Interface().(Item)
}
diff --git a/lib/btrfs/btrfsitem/statmode.go b/lib/btrfs/btrfsitem/statmode.go
index a1302ee..557b688 100644
--- a/lib/btrfs/btrfsitem/statmode.go
+++ b/lib/btrfs/btrfsitem/statmode.go
@@ -1,5 +1,5 @@
// Copyright (C) 2020-2021 Ambassador Labs
-// Copyright (C) 2022 Luke Shumaker <lukeshu@lukeshu.com>
+// Copyright (C) 2022-2023 Luke Shumaker <lukeshu@lukeshu.com>
//
// SPDX-License-Identifier: Apache-2.0
//
@@ -9,7 +9,6 @@ package btrfsitem
type StatMode uint32
-//nolint:deadcode,varcheck // not all of these modes will be used
const (
// 16 bits = 5⅓ octal characters
@@ -73,6 +72,7 @@ func (mode StatMode) IsRegular() bool {
// 's' (GNU `ls` behavior; though POSIX notes that many
// implementations use '=' for sockets).
func (mode StatMode) String() string {
+ //nolint:gomnd // Magic numbers is all this is.
buf := [10]byte{
// type: This string is easy; it directly pairs with
// the above ModeFmtXXX list above; the character in