diff options
Diffstat (limited to 'internal/cmd')
-rw-r--r-- | internal/cmd/cert.go | 6 | ||||
-rw-r--r-- | internal/cmd/serv.go | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/internal/cmd/cert.go b/internal/cmd/cert.go index f13d8949..ef3f2a2a 100644 --- a/internal/cmd/cert.go +++ b/internal/cmd/cert.go @@ -41,7 +41,7 @@ Outputs to 'cert.pem' and 'key.pem' and will overwrite existing files.`, }, } -func publicKey(priv interface{}) interface{} { +func publicKey(priv any) any { switch k := priv.(type) { case *rsa.PrivateKey: return &k.PublicKey @@ -52,7 +52,7 @@ func publicKey(priv interface{}) interface{} { } } -func pemBlockForKey(priv interface{}) *pem.Block { +func pemBlockForKey(priv any) *pem.Block { switch k := priv.(type) { case *rsa.PrivateKey: return &pem.Block{Type: "RSA PRIVATE KEY", Bytes: x509.MarshalPKCS1PrivateKey(k)} @@ -72,7 +72,7 @@ func runCert(ctx *cli.Context) error { log.Fatal("Missing required --host parameter") } - var priv interface{} + var priv any var err error switch ctx.String("ecdsa-curve") { case "": diff --git a/internal/cmd/serv.go b/internal/cmd/serv.go index f4ef7020..accffc94 100644 --- a/internal/cmd/serv.go +++ b/internal/cmd/serv.go @@ -38,7 +38,7 @@ var Serv = cli.Command{ // fail prints user message to the Git client (i.e. os.Stderr) and // logs error message on the server side. When not in "prod" mode, // error message is also printed to the client for easier debugging. -func fail(userMessage, errMessage string, args ...interface{}) { +func fail(userMessage, errMessage string, args ...any) { _, _ = fmt.Fprintln(os.Stderr, "Gogs:", userMessage) if len(errMessage) > 0 { |