From 1fb4a2c2c63c9a966bb6f6f5e45ed07418f7c2d2 Mon Sep 17 00:00:00 2001 From: rcourtman Date: Thu, 27 Nov 2025 10:16:08 +0000 Subject: [PATCH] chore: remove deprecated build tags and use strings.ReplaceAll - Remove redundant // +build directives (go:build is sufficient in Go 1.17+) - Replace strings.Replace(..., -1) with strings.ReplaceAll --- cmd/pulse-host-agent/service_stub.go | 1 - cmd/pulse-host-agent/service_windows.go | 1 - internal/api/config_handlers.go | 2 +- 3 files changed, 1 insertion(+), 3 deletions(-) diff --git a/cmd/pulse-host-agent/service_stub.go b/cmd/pulse-host-agent/service_stub.go index 8573a5a..e324496 100644 --- a/cmd/pulse-host-agent/service_stub.go +++ b/cmd/pulse-host-agent/service_stub.go @@ -1,5 +1,4 @@ //go:build !windows -// +build !windows package main diff --git a/cmd/pulse-host-agent/service_windows.go b/cmd/pulse-host-agent/service_windows.go index bc1b2a3..f0a2054 100644 --- a/cmd/pulse-host-agent/service_windows.go +++ b/cmd/pulse-host-agent/service_windows.go @@ -1,5 +1,4 @@ //go:build windows -// +build windows package main diff --git a/internal/api/config_handlers.go b/internal/api/config_handlers.go index 0aa7373..b3b371a 100644 --- a/internal/api/config_handlers.go +++ b/internal/api/config_handlers.go @@ -6007,7 +6007,7 @@ func (h *ConfigHandlers) handleSecureAutoRegister(w http.ResponseWriter, _ *http // Generate a unique token name based on Pulse's IP/hostname hostname, _ := os.Hostname() if hostname == "" { - hostname = strings.Replace(clientIP, ".", "-", -1) + hostname = strings.ReplaceAll(clientIP, ".", "-") } timestamp := time.Now().Unix() tokenName := fmt.Sprintf("pulse-%s-%d", hostname, timestamp)