From 9c2e580ab56654b6ccf2ec8c6d57c935f047f91d Mon Sep 17 00:00:00 2001 From: caelansar <819711623@qq.com> Date: Thu, 19 Jan 2023 09:25:48 +0800 Subject: [PATCH] put Where before Find --- machine.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/machine.go b/machine.go index b13cd48b..2d3a076b 100644 --- a/machine.go +++ b/machine.go @@ -352,7 +352,7 @@ func (h *Headscale) ListMachines() ([]Machine, error) { func (h *Headscale) ListMachinesByGivenName(givenName string) ([]Machine, error) { machines := []Machine{} - if err := h.db.Preload("AuthKey").Preload("AuthKey.User").Preload("User").Find(&machines).Where("given_name = ?", givenName).Error; err != nil { + if err := h.db.Preload("AuthKey").Preload("AuthKey.User").Preload("User").Where("given_name = ?", givenName).Find(&machines).Error; err != nil { return nil, err }