From e49ec58808e437b77759e5ab74baa5a6296b8ce7 Mon Sep 17 00:00:00 2001 From: Runxi Yu Date: Tue, 18 Feb 2025 14:30:24 +0800 Subject: [PATCH] *.go: Reformat --- resources.go | 3 +++ ssh_server.go | 2 +- diff --git a/resources.go b/resources.go index 2fe7883b2333c8e8a8acefc053b9d0bee4a5da12..81830a45f0f69171ccadacf63f584d57c4b38f01 100644 --- a/resources.go +++ b/resources.go @@ -8,6 +8,7 @@ "net/http" ) // We embed all source for easy AGPL compliance. +// //go:embed .gitignore .gitattributes //go:embed LICENSE README.md //go:embed *.go go.mod go.sum @@ -18,6 +19,7 @@ //go:embed static/* templates/* //go:embed git_hooks_client/*.c //go:embed vendor/* var source_fs embed.FS + var source_handler = http.StripPrefix( "/:/source/", http.FileServer(http.FS(source_fs)), @@ -27,6 +29,7 @@ //go:embed templates/* static/* git_hooks_client/git_hooks_client var resources_fs embed.FS var templates *template.Template + func load_templates() (err error) { templates, err = template.New("templates").Funcs(template.FuncMap{ "first_line": first_line, diff --git a/ssh_server.go b/ssh_server.go index 1630babdc6661b9181f31102d2ad445bb649042a..81906f5304c8791a1ba2d205bd2ab38067d15ca6 100644 --- a/ssh_server.go +++ b/ssh_server.go @@ -41,7 +41,7 @@ client_public_key_string = strings.TrimSuffix(string(go_ssh.MarshalAuthorizedKey(client_public_key)), "\n") } clog.Info("Incoming SSH: " + session.RemoteAddr().String() + " " + client_public_key_string + " " + session.RawCommand()) - fmt.Fprintln(session.Stderr(), "Lindenii Forge "+VERSION+", source at "+strings.TrimSuffix(config.HTTP.Root, "/") + "/:/source/\r") + fmt.Fprintln(session.Stderr(), "Lindenii Forge "+VERSION+", source at "+strings.TrimSuffix(config.HTTP.Root, "/")+"/:/source/\r") cmd := session.Command() -- 2.48.1