diff options
author | Runxi Yu <me@runxiyu.org> | 2025-02-16 00:32:46 +0800 |
---|---|---|
committer | Runxi Yu <me@runxiyu.org> | 2025-02-16 00:33:04 +0800 |
commit | 2cd785fc9e7d25e7504fa552cd94607d250665b0 (patch) | |
tree | 8c72000e687ad1841358353aae87693e05e266cf /misc.go | |
parent | README.md: Add Libera channel (diff) | |
download | forge-2cd785fc9e7d25e7504fa552cd94607d250665b0.tar.gz forge-2cd785fc9e7d25e7504fa552cd94607d250665b0.tar.zst forge-2cd785fc9e7d25e7504fa552cd94607d250665b0.zip |
ssh_*: Use pure go-git SSH handling (receive and upload)
Diffstat (limited to '')
-rw-r--r-- | misc.go | 18 |
1 files changed, 18 insertions, 0 deletions
@@ -1,6 +1,24 @@ package main +import ( + "errors" + "strings" +) + type name_desc_t struct { Name string Description string } + +var err_environ_no_separator = errors.New("No separator found in environ line") + +func environ_to_map(environ_strings []string) (result map[string]string, err error) { + for _, environ_string := range environ_strings { + key, value, found := strings.Cut(environ_string, "=") + if !found { + return result, err_environ_no_separator + } + result[key] = value + } + return result, err_environ_no_separator +} |