From 5af9906d829cd38f35da069c41056bb465c515b9 Mon Sep 17 00:00:00 2001 From: Andreas Jansson Date: Wed, 6 Jan 2021 18:19:06 +0100 Subject: [PATCH] disable host local ip Signed-off-by: Andreas Jansson --- go/pkg/project/project.go | 32 +------------------------------- 1 file changed, 1 insertion(+), 31 deletions(-) diff --git a/go/pkg/project/project.go b/go/pkg/project/project.go index bd7f2de0..f0b2639e 100644 --- a/go/pkg/project/project.go +++ b/go/pkg/project/project.go @@ -4,7 +4,6 @@ import ( "encoding/json" "fmt" "math/rand" - "net" "os/user" "strings" "time" @@ -214,13 +213,7 @@ func (p *Project) CreateExperiment(args CreateExperimentArgs, async bool, workCh return nil, errors.IncompatibleRepositoryVersion(p.repository.RootURL()) } - hostIP, err := localIP() - host := "" - if err == nil { - host = hostIP.String() - } else { - console.Warn("Failed to determine host IP: %s", err) - } + host := "" // currently disabled and unused currentUser, err := user.Current() username := "" if err == nil { @@ -404,26 +397,3 @@ func generateRandomID() string { } return b.String() } - -// Get local IP address of this machine -func localIP() (net.IP, error) { - ifaces, err := net.Interfaces() - if err != nil { - return nil, err - } - for _, iface := range ifaces { - addrs, err := iface.Addrs() - if err != nil { - return nil, err - } - for _, addr := range addrs { - switch v := addr.(type) { - case *net.IPNet: - return v.IP, nil - case *net.IPAddr: - return v.IP, nil - } - } - } - return nil, fmt.Errorf("No local IP address found") -}