Go format with shorter lines

This commit is contained in:
Kristoffer Dalby
2021-11-13 08:36:45 +00:00
parent edfcdc466c
commit 03b7ec62ca
35 changed files with 794 additions and 192 deletions

View File

@@ -105,7 +105,10 @@ func (h *Headscale) ExpirePreAuthKey(k *PreAuthKey) error {
// If returns no error and a PreAuthKey, it can be used
func (h *Headscale) checkKeyValidity(k string) (*PreAuthKey, error) {
pak := PreAuthKey{}
if result := h.db.Preload("Namespace").First(&pak, "key = ?", k); errors.Is(result.Error, gorm.ErrRecordNotFound) {
if result := h.db.Preload("Namespace").First(&pak, "key = ?", k); errors.Is(
result.Error,
gorm.ErrRecordNotFound,
) {
return nil, errorAuthKeyNotFound
}