git » summer » commit 46f4db9

Apply `go fix` to the codebase

author Alberto Bertogli
2026-10-30 14:25:19 UTC
committer Alberto Bertogli
2026-10-30 14:25:19 UTC
parent eba08f0e0bcb646ab0448660aeaafb0fd8926f77

Apply `go fix` to the codebase

This patch applies `go fix` to all the codebase, to bring it up to
modern standards.

db.go +3 -4
ui.go +3 -3

diff --git a/db.go b/db.go
index a6b3acd..ec54255 100644
--- a/db.go
+++ b/db.go
@@ -5,6 +5,7 @@ import (
 	"encoding/binary"
 	"flag"
 	"os"
+	"slices"
 
 	"github.com/pkg/xattr"
 )
@@ -23,10 +24,8 @@ type XattrDB struct{}
 
 func (_ XattrDB) Has(f *os.File) (bool, error) {
 	attrs, err := xattr.FList(f)
-	for _, a := range attrs {
-		if a == "user.summer-v1" {
-			return true, err
-		}
+	if slices.Contains(attrs, "user.summer-v1") {
+		return true, err
 	}
 	return false, err
 }
diff --git a/ui.go b/ui.go
index ef86afa..96eef2d 100644
--- a/ui.go
+++ b/ui.go
@@ -14,19 +14,19 @@ var (
 	quiet   = flag.Bool("q", false, "quiet mode")
 )
 
-func Verbosef(format string, args ...interface{}) {
+func Verbosef(format string, args ...any) {
 	if *verbose {
 		fmt.Printf(format+"\n", args...)
 	}
 }
 
-func Printf(format string, args ...interface{}) {
+func Printf(format string, args ...any) {
 	if !*quiet {
 		fmt.Printf(format+"\n", args...)
 	}
 }
 
-func Fatalf(format string, args ...interface{}) {
+func Fatalf(format string, args ...any) {
 	fmt.Printf(format+"\n", args...)
 	os.Exit(1)
 }