1
0
mirror of https://blitiri.com.ar/repos/chasquid synced 2026-10-29 15:02:30 +00:00

Apply go fix to simplify using modern features

This patch contains the result of running `go fix ./...`, which applies
simplifications that make use of modern language features.

There are no logic or behaviour changes.
This commit is contained in:
Alberto Bertogli
2026-10-02 18:34:25 +01:00
parent 9785738a58
commit 0210c5fd92
37 changed files with 89 additions and 105 deletions
+3 -4
View File
@@ -1,5 +1,4 @@
//go:build !coverage
// +build !coverage
// Utility to generate self-signed certificates.
// It generates a self-signed x509 certificate and key pair, and writes them
@@ -34,7 +33,7 @@ var (
"Should this cert be its own CA?")
)
func fatalf(f string, a ...interface{}) {
func fatalf(f string, a ...any) {
fmt.Printf(f, a...)
os.Exit(1)
}
@@ -71,8 +70,8 @@ func main() {
tmpl.IsCA = true
}
hosts := strings.Split(*host, ",")
for _, h := range hosts {
hosts := strings.SplitSeq(*host, ",")
for h := range hosts {
if ip := net.ParseIP(h); ip != nil {
tmpl.IPAddresses = append(tmpl.IPAddresses, ip)
} else {