From 3aae548374b0ca19b9e14c30a1ca6790251cc1db Mon Sep 17 00:00:00 2001 From: Runxi Yu Date: Sat, 15 Feb 2025 10:23:08 +0800 Subject: [PATCH] *.go: Reformat --- http_handle_repo_commit.go | 2 +- http_server.go | 8 ++++---- ssh_server.go | 2 +- url.go | 2 +- diff --git a/http_handle_repo_commit.go b/http_handle_repo_commit.go index 8e5cdbfc6ed16ec7c9eb2149ff321eb48122eb0c..0eb6bb4c82dbab06ab3868e2a13a04ab0ed5a700 100644 --- a/http_handle_repo_commit.go +++ b/http_handle_repo_commit.go @@ -76,7 +76,7 @@ if to == nil { to = fake_diff_file_null } chunks := []usable_chunk{} - for _, chunk := range file_patch.Chunks() { + for _, chunk := range file_patch.Chunks() { content := chunk.Content() if len(content) > 0 && content[0] == '\n' { content = "\n" + content diff --git a/http_server.go b/http_server.go index e830fb1d0ebb58b1ad92264739690d8c943c6c9f..ffbb7114fd973d14673a4190aeba9defeb00be99 100644 --- a/http_server.go +++ b/http_server.go @@ -122,9 +122,9 @@ } } // TODO: subgroups if non_empty_last_segments_len == separator_index+3 { - if redirect_with_slash(w, r) { - return - } + if redirect_with_slash(w, r) { + return + } handle_repo_index(w, r, params) return } @@ -135,7 +135,7 @@ handle_repo_info(w, r, params) case "tree": params["rest"] = strings.Join(segments[separator_index+4:], "/") if len(segments) < separator_index+5 && redirect_with_slash(w, r) { - return + return } handle_repo_tree(w, r, params) case "raw": diff --git a/ssh_server.go b/ssh_server.go index 70767aaad825a74425919944e3840bd3dc11f811..0dde4b4bb27d95d318d1d295f273dfe1bb8ba132 100644 --- a/ssh_server.go +++ b/ssh_server.go @@ -42,7 +42,7 @@ client_public_key_string = string(go_ssh.MarshalAuthorizedKey(client_public_key)) } clog.Info("Incoming SSH: " + session.RemoteAddr().String() + " " + strings.TrimSuffix(client_public_key_string, "\n") + " " + 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() diff --git a/url.go b/url.go index 7712639814721dad3bf8c8adac8757dae87ea559..37ec699fb813bec99b6c2d5b45519e2fbf13dd04 100644 --- a/url.go +++ b/url.go @@ -11,7 +11,7 @@ ) var ( err_duplicate_ref_spec = errors.New("Duplicate ref spec") - err_no_ref_spec = errors.New("No ref spec") + err_no_ref_spec = errors.New("No ref spec") ) func get_param_ref_and_type(r *http.Request) (ref_type, ref string, err error) { -- 2.48.1