aboutsummaryrefslogtreecommitdiff
path: root/pkg/config/config.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/config/config.go')
-rw-r--r--pkg/config/config.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/pkg/config/config.go b/pkg/config/config.go
index dfd3d0e..993cd71 100644
--- a/pkg/config/config.go
+++ b/pkg/config/config.go
@@ -29,7 +29,7 @@ type GlobalOptions struct {
var DefaultGlobalOptions = GlobalOptions{
Timeout: 30,
MaxFailures: 10,
- DefaultEmail: username() + "@" + hostname(),
+ DefaultEmail: username() + "@" + Hostname(),
Target: "",
Parts: []string{"text", "html"},
}
@@ -120,7 +120,8 @@ func Load(path string) (*Config, error) {
return cfg, nil
}
-func hostname() (hostname string) {
+// Hostname returns the current hostname, or 'localhost' if it cannot be determined
+func Hostname() (hostname string) {
hostname, err := os.Hostname()
if err != nil {
hostname = "localhost"
essage from 0.13.0 to 0.14.0 (#38)dependabot[bot]2-3/+9 2020-11-28Bump github.com/google/go-cmp from 0.5.2 to 0.5.4 (#37)dependabot[bot]2-3/+3 2020-11-23Fix release.ymlv0.5.2René 'Necoro' Neumann1-3/+10 2020-11-23Prepare v0.5.2René 'Necoro' Neumann3-3/+8 2020-11-20Bump github.com/gabriel-vasile/mimetype from 1.1.1 to 1.1.2dependabot[bot]2-3/+3 2020-11-04Clean dependabot.ymlRené 'Necoro' Neumann1-4/+0