From 6fc5d416a289235dd4bb56d29fb96c5a003ea89f Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sat, 11 Jun 2022 22:30:35 -0600 Subject: use %v when possible Exceptions are - the occasional %x when the type is a basic int - %w - %q - %T - whenever print_tree.go needs to be dumb for compatibility with C --- pkg/btrfs/io1_device.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'pkg/btrfs/io1_device.go') diff --git a/pkg/btrfs/io1_device.go b/pkg/btrfs/io1_device.go index 978d388..32070cd 100644 --- a/pkg/btrfs/io1_device.go +++ b/pkg/btrfs/io1_device.go @@ -56,7 +56,7 @@ func (dev *Device) Superblocks() ([]*util.Ref[PhysicalAddr, Superblock], error) Addr: addr, } if err := superblock.Read(); err != nil { - return nil, fmt.Errorf("superblock %d: %w", i, err) + return nil, fmt.Errorf("superblock %v: %w", i, err) } ret = append(ret, superblock) } @@ -79,11 +79,11 @@ func (dev *Device) Superblock() (*util.Ref[PhysicalAddr, Superblock], error) { for i, sb := range sbs { if err := sb.Data.ValidateChecksum(); err != nil { - return nil, fmt.Errorf("superblock %d: %w", i, err) + return nil, fmt.Errorf("superblock %v: %w", i, err) } if i > 0 { if !sb.Data.Equal(sbs[0].Data) { - return nil, fmt.Errorf("superblock %d and superblock %d disagree", 0, i) + return nil, fmt.Errorf("superblock %v and superblock %v disagree", 0, i) } } } -- cgit v1.2.3-2-g168b