From 80dc4b35314128707b7aebd435441004d2411fb5 Mon Sep 17 00:00:00 2001 From: Siraj Ravel <jason.ravel@cbsinteractive.com> Date: Wed, 10 Sep 2014 13:31:40 -0700 Subject: [PATCH] gofmt-d and golint-d --- daemon/daemon.go | 6 +++--- daemon/daemon_client.go | 9 ++++----- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/daemon/daemon.go b/daemon/daemon.go index 70552e4ed..a846ba002 100644 --- a/daemon/daemon.go +++ b/daemon/daemon.go @@ -2,7 +2,6 @@ package daemon import ( "encoding/json" - "errors" "fmt" "io" "net" @@ -13,14 +12,15 @@ import ( u "github.com/jbenet/go-ipfs/util" ) -var ErrInvalidCommand = errors.New("invalid command") - +//DaemonListener listens to an initialized IPFS node and can send it commands instead of +//starting up a new set of connections type DaemonListener struct { node *core.IpfsNode list net.Listener closed bool } +//Command accepts user input and can be sent to the running IPFS node type Command struct { Command string Args []string diff --git a/daemon/daemon_client.go b/daemon/daemon_client.go index 83174076a..a63f4a398 100644 --- a/daemon/daemon_client.go +++ b/daemon/daemon_client.go @@ -5,15 +5,14 @@ import ( "io" "net" "os" - "time" + "time" ) - -//connects to the address on the network with a timeout and encodes the connection into JSON +//SendCommand connects to the address on the network with a timeout and encodes the connection into JSON func SendCommand(command *Command, server string) error { - + conn, err := net.DialTimeout("tcp", server, time.Millisecond*300) - + if err != nil { return err } -- GitLab