From 10e4fb47da2753fc8db753693c4d5893e54dbec7 Mon Sep 17 00:00:00 2001 From: Your Name Date: Tue, 8 Oct 2024 18:27:12 -0400 Subject: [PATCH] autocomplete --- go.mod | 2 +- go.sum | 2 ++ main.go | 6 +++--- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/go.mod b/go.mod index 2115886..c1724ca 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module git.teamworkapps.com/shortcut/docker-mailserver-passwords go 1.22.2 require ( - git.teamworkapps.com/shortcut/forms v0.0.0-20240812141315-1ed2ebc91b92 + git.teamworkapps.com/shortcut/forms v0.0.0-20241008222643-619c5114ff98 github.com/gorilla/mux v1.8.1 github.com/knadh/go-pop3 v1.0.0 ) diff --git a/go.sum b/go.sum index cb8bd4b..c5912d8 100644 --- a/go.sum +++ b/go.sum @@ -2,6 +2,8 @@ git.teamworkapps.com/shortcut/forms v0.0.0-20240319204456-8f50f1d78d23 h1:3UWDUv git.teamworkapps.com/shortcut/forms v0.0.0-20240319204456-8f50f1d78d23/go.mod h1:1ElXS6rlK/NaNDQoqfCALVVKnwaSYAg2pNF8Ksvoc3Y= git.teamworkapps.com/shortcut/forms v0.0.0-20240812141315-1ed2ebc91b92 h1:58ahYebx7K9oYuLRgUMwpTyp5xy1xsKIxVb+GEXGmgo= git.teamworkapps.com/shortcut/forms v0.0.0-20240812141315-1ed2ebc91b92/go.mod h1:1ElXS6rlK/NaNDQoqfCALVVKnwaSYAg2pNF8Ksvoc3Y= +git.teamworkapps.com/shortcut/forms v0.0.0-20241008222643-619c5114ff98 h1:qu2By0n7SZ12veS3syyC3fFScL2Yd1R6+dBOfgVKAXc= +git.teamworkapps.com/shortcut/forms v0.0.0-20241008222643-619c5114ff98/go.mod h1:1ElXS6rlK/NaNDQoqfCALVVKnwaSYAg2pNF8Ksvoc3Y= github.com/emersion/go-message v0.15.0 h1:urgKGqt2JAc9NFJcgncQcohHdiYb803YTH9OQwHBHIY= github.com/emersion/go-message v0.15.0/go.mod h1:wQUEfE+38+7EW8p8aZ96ptg6bAb1iwdgej19uXASlE4= github.com/emersion/go-textwrapper v0.0.0-20200911093747-65d896831594 h1:IbFBtwoTQyw0fIM5xv1HF+Y+3ZijDR839WMulgxCcUY= diff --git a/main.go b/main.go index 31b603f..0e7f04b 100644 --- a/main.go +++ b/main.go @@ -151,7 +151,7 @@ recreation@pinnaclelake.com|{SHA512-CRYPT}$6$uTiy7Q5xn1CIN22w$3VAElns3TFfejtdTCT // createPasswordEntry: input email and plain text password, output a password entry with sha512-crypt. func modifyPasswordFile(email, password string) bool { - email=strings.ToLower(email) + email = strings.ToLower(email) log.Printf("Changing password for %s", email) // read the password file // find the entry with the given email @@ -170,11 +170,11 @@ func modifyPasswordFile(email, password string) bool { lines := strings.Split(string(in), "\n") for _, line := range lines { - tmp:=strings.Split(line,"|") + tmp := strings.Split(line, "|") if len(tmp) != 2 { continue } - if tmp[0]==email { + if tmp[0] == email { line = createPasswordEntry(email, password) } out.WriteString(line)