summaryrefslogtreecommitdiff
path: root/post.go
diff options
context:
space:
mode:
Diffstat (limited to 'post.go')
-rw-r--r--post.go7
1 files changed, 3 insertions, 4 deletions
diff --git a/post.go b/post.go
index 43c12bf..8116ea7 100644
--- a/post.go
+++ b/post.go
@@ -24,11 +24,10 @@ func HttpPost(baseURL string, route string, data []byte) ([]byte, error) {
return nil, err
}
- usr, _ := user.Current()
- if os.Getenv("GIT_AUTHOR_NAME") == "" {
+ username := os.Getenv("GIT_AUTHOR_NAME")
+ if username == "" {
+ usr, _ := user.Current()
username = usr.Username
- } else {
- usernname = os.Getenv("GIT_AUTHOR_NAME")
}
req.Header.Set("author", username)
hostname, _ := os.Hostname()