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
This commit is contained in:
parent
31927f71e9
commit
1fb4a2c2c6
3 changed files with 1 additions and 3 deletions
|
|
@ -1,5 +1,4 @@
|
|||
//go:build !windows
|
||||
// +build !windows
|
||||
|
||||
package main
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
//go:build windows
|
||||
// +build windows
|
||||
|
||||
package main
|
||||
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in a new issue