mirror of
https://github.com/juanfont/headscale.git
synced 2024-11-29 18:33:05 +00:00
Fix implicit memory aliasing in for loop (lint 8/n)
This commit is contained in:
parent
ffcc72876c
commit
00885dffe1
1 changed files with 2 additions and 2 deletions
4
db.go
4
db.go
|
@ -89,7 +89,7 @@ func (h *Headscale) initDB() error {
|
|||
log.Error().Err(err).Msg("Error accessing db")
|
||||
}
|
||||
|
||||
for _, machine := range machines {
|
||||
for item, machine := range machines {
|
||||
if machine.GivenName == "" {
|
||||
normalizedHostname, err := NormalizeToFQDNRules(
|
||||
machine.Hostname,
|
||||
|
@ -103,7 +103,7 @@ func (h *Headscale) initDB() error {
|
|||
Msg("Failed to normalize machine hostname in DB migration")
|
||||
}
|
||||
|
||||
err = h.RenameMachine(&machine, normalizedHostname)
|
||||
err = h.RenameMachine(&machines[item], normalizedHostname)
|
||||
if err != nil {
|
||||
log.Error().
|
||||
Caller().
|
||||
|
|
Loading…
Reference in a new issue