use os.Hostname()

This commit is contained in:
Jeff Carr 2024-03-09 18:05:49 -06:00
parent 316c1b8cc2
commit efba612ad6
2 changed files with 4 additions and 4 deletions

View File

@ -23,7 +23,7 @@ var lw *gadgets.BasicWindow
var allsections []*section var allsections []*section
type witRepo struct { type witRepo struct {
hidden bool hidden bool
sec *section sec *section
path *gui.Node path *gui.Node
downloadB *gui.Node downloadB *gui.Node
@ -108,7 +108,7 @@ func ListWindow(view *repolist.RepoList) *gadgets.BasicWindow {
var lines []string var lines []string
var currents *section var currents *section
currents = NewSection(group, "local " + view.Cfgfile()) currents = NewSection(group, "local "+view.Cfgfile())
for i, line := range myrepolist(view.Cfgfile()) { for i, line := range myrepolist(view.Cfgfile()) {
line = strings.TrimSpace(line) line = strings.TrimSpace(line)
if line == "" { if line == "" {

View File

@ -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{}