Skip to content

Commit

Permalink
Fix MacOS build
Browse files Browse the repository at this point in the history
Signed-off-by: Anton Litvinov <[email protected]>
  • Loading branch information
Zensey committed Mar 7, 2024
1 parent a63270d commit 552aa20
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions services/wireguard/service/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ package service
import (
"encoding/json"
"fmt"
"maps"
"net"
"sync"
"time"

"github.com/jinzhu/copier"
"github.com/pkg/errors"
"github.com/rs/zerolog/log"

Expand Down Expand Up @@ -277,7 +277,9 @@ func (m *Manager) Stop() error {

// prevent concurrent iteration and write
sessionCleanupCopy := make(map[string]func())
maps.Copy(sessionCleanupCopy, m.sessionCleanup)
if err := copier.Copy(&sessionCleanupCopy, m.sessionCleanup); err != nil {
panic(err)
}
for k, v := range sessionCleanupCopy {
cleanupWg.Add(1)
go func(sessionID string, cleanup func()) {
Expand Down

0 comments on commit 552aa20

Please sign in to comment.