mirror of
https://github.com/juanfont/headscale.git
synced 2026-09-18 06:22:05 +09:00
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:
committed by
Kristoffer Dalby
parent
2b64b9fe3a
commit
2c76d5c5b7
@@ -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()
|
||||
|
||||
@@ -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",
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user