all: apply golangci-lint autofixes

Go 1.27 allows setting promoted fields of embedded structs directly in
composite literals, so gorm.Model wrappers go away. Plus strings.Cut,
errors.AsType, reflect.TypeAssert and one gofumpt nit.
This commit is contained in:
Kristoffer Dalby
2026-08-25 07:20:06 +00:00
committed by Kristoffer Dalby
parent 2b64b9fe3a
commit 2c76d5c5b7
29 changed files with 195 additions and 218 deletions
+1 -2
View File
@@ -5,7 +5,6 @@ import (
"github.com/juanfont/headscale/hscontrol/util"
"github.com/stretchr/testify/assert"
"gorm.io/gorm"
)
// TestNodeIsTagged tests the [Node.IsTagged] method for determining if a node is tagged.
@@ -285,7 +284,7 @@ func TestNodeOwnershipModel(t *testing.T) {
// TestUserTypedID tests the TypedID() helper method.
func TestUserTypedID(t *testing.T) {
user := User{
Model: gorm.Model{ID: 42},
ID: 42,
}
typedID := user.TypedID()
+1 -1
View File
@@ -40,7 +40,7 @@ const (
// Tagged nodes don't belong to a real user - the tag is their identity.
// This special user ID is used when rendering tagged nodes in the Tailscale protocol.
var TaggedDevices = User{
Model: gorm.Model{ID: TaggedDevicesUserID},
ID: TaggedDevicesUserID,
Name: "tagged-devices",
DisplayName: "Tagged Devices",
}