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

5
db.go
View file

@ -87,7 +87,10 @@ func (h *Headscale) openDB() (*gorm.DB, error) {
// getValue returns the value for the given key in KV
func (h *Headscale) getValue(key string) (string, error) {
var row KV
if result := h.db.First(&row, "key = ?", key); errors.Is(result.Error, gorm.ErrRecordNotFound) {
if result := h.db.First(&row, "key = ?", key); errors.Is(
result.Error,
gorm.ErrRecordNotFound,
) {
return "", errors.New("not found")
}
return row.Value, nil