Skip to content
Snippets Groups Projects
Unverified Commit d6203bce authored by Max Adamo's avatar Max Adamo
Browse files

fix: improve error message formatting and enhance comments for clarity

parent 40a83413
Branches
No related tags found
No related merge requests found
...@@ -216,14 +216,13 @@ Options: ...@@ -216,14 +216,13 @@ Options:
cfg, err := ini.Load("/root/.acme.ini") cfg, err := ini.Load("/root/.acme.ini")
if err != nil { if err != nil {
fmt.Printf("Fail to read file: %v", err) fmt.Printf("Fail to read file: %v\n", err)
os.Exit(1) os.Exit(1)
} }
bearerToken = cfg.Section("acme").Key("bearer_token").String() bearerToken = cfg.Section("acme").Key("bearer_token").String()
// remove leading and trailing spaces and quotes and split by comma
acmeProvidersRaw := cfg.Section("acme").Key("acme_providers").String() acmeProvidersRaw := cfg.Section("acme").Key("acme_providers").String()
acmeProvidersRaw = strings.Trim(acmeProvidersRaw, "[] ") acmeProvidersRaw = strings.Trim(acmeProvidersRaw, "[] ") // remove leading and trailing brackets and spaces
acmeProviders := strings.Split(acmeProvidersRaw, ",") acmeProviders := strings.Split(acmeProvidersRaw, ",") // split by comma
for i := range acmeProviders { for i := range acmeProviders {
acmeProviders[i] = strings.Trim(acmeProviders[i], "' ") acmeProviders[i] = strings.Trim(acmeProviders[i], "' ")
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment