Content-Length: 242758 | pFad | http://github.com/nfx/slrp/commit/954c8b72569603fa5a95c9e5fed0b17cc224e8f1

0F Fix configuration reporting (#142) · nfx/slrp@954c8b7 · GitHub
Skip to content

Commit

Permalink
Fix configuration reporting (#142)
Browse files Browse the repository at this point in the history
  • Loading branch information
nfx authored Jul 30, 2023
1 parent 596413f commit 954c8b7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@ coverage.txt
slrp
package-lock.json
.vagrant
*.patch
14 changes: 6 additions & 8 deletions app/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,15 +118,13 @@ func getConfig() (configuration, error) {
validLoc = loc
break
}
os.Stderr.WriteString(fmt.Sprintf("Loading config: %s\n", validLoc))
data := configuration{}
err = yaml.Unmarshal(raw, &data)
if err != nil {
return nil, fmt.Errorf("invalid config in %s: %w", validLoc, err)
}
if data == nil {
// when there's no config
data = configuration{}
if validLoc != "" {
os.Stderr.WriteString(fmt.Sprintf("Loading config: %s\n", validLoc))
err = yaml.Unmarshal(raw, &data)
if err != nil {
return nil, fmt.Errorf("invalid config in %s: %w", validLoc, err)
}
}
for _, raw := range os.Environ() {
rawSplit := strings.SplitN(raw, "=", 2)
Expand Down

0 comments on commit 954c8b7

Please sign in to comment.








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/nfx/slrp/commit/954c8b72569603fa5a95c9e5fed0b17cc224e8f1

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy