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
@@ -3,7 +3,6 @@
// See the usage below for details.
//
//go:build !coverage
// +build !coverage
package main
@@ -51,13 +50,13 @@ Flags:
}
// Exit with EX_TEMPFAIL.
func tempExit(format string, args ...interface{}) {
func tempExit(format string, args ...any) {
fmt.Printf(format+"\n", args...)
// 75 = EX_TEMPFAIL "temporary failure" exit code (sysexits.h).
os.Exit(75)
}
func permExit(format string, args ...interface{}) {
func permExit(format string, args ...any) {
fmt.Printf(format+"\n", args...)
os.Exit(2)
}
@@ -142,7 +141,7 @@ func main() {
}
// cmd sends a command and checks it matched the expected code.
func cmd(conn *textproto.Conn, expectCode int, format string, args ...interface{}) {
func cmd(conn *textproto.Conn, expectCode int, format string, args ...any) {
id, err := conn.Cmd(format, args...)
if err != nil {
tempExit("Sent %q, got %v", fmt.Sprintf(format, args...), err)