use os.Hostname()
This commit is contained in:
parent
316c1b8cc2
commit
efba612ad6
|
@ -4,10 +4,10 @@ import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
"os"
|
||||||
"os/user"
|
"os/user"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"go.wit.com/lib/gui/shell"
|
|
||||||
"go.wit.com/log"
|
"go.wit.com/log"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@ func Register(gopath string, giturl string) bool {
|
||||||
req.Header.Set("giturl", giturl)
|
req.Header.Set("giturl", giturl)
|
||||||
usr, _ := user.Current()
|
usr, _ := user.Current()
|
||||||
req.Header.Set("author", usr.Username)
|
req.Header.Set("author", usr.Username)
|
||||||
hostname := shell.RunCapture("hostname -f")
|
hostname, _ := os.Hostname()
|
||||||
req.Header.Set("hostname", hostname)
|
req.Header.Set("hostname", hostname)
|
||||||
|
|
||||||
client := &http.Client{}
|
client := &http.Client{}
|
||||||
|
|
Loading…
Reference in New Issue