@@ -46,10 +46,10 @@ func Exists(socketPath string) bool {
4646 conn , err := net .Dial ("unix" , socketPath )
4747 if err != nil {
4848 // Socket file might exist but daemon not running
49- os .Remove (socketPath )
49+ _ = os .Remove (socketPath )
5050 return false
5151 }
52- conn .Close ()
52+ _ = conn .Close ()
5353 return true
5454}
5555
@@ -84,7 +84,7 @@ func New(cfg *config.Config, socketPath string) *Daemon {
8484// Start starts the daemon
8585func (d * Daemon ) Start () error {
8686 // Remove stale socket
87- os .Remove (d .socketPath )
87+ _ = os .Remove (d .socketPath )
8888
8989 listener , err := net .Listen ("unix" , d .socketPath )
9090 if err != nil {
@@ -119,17 +119,17 @@ func (d *Daemon) Stop() {
119119 }
120120
121121 if d .listener != nil {
122- d .listener .Close ()
122+ _ = d .listener .Close ()
123123 }
124124
125125 d .clientsMu .Lock ()
126126 for c := range d .clients {
127- c .conn .Close ()
127+ _ = c .conn .Close ()
128128 }
129129 d .clientsMu .Unlock ()
130130
131131 d .wg .Wait ()
132- os .Remove (d .socketPath )
132+ _ = os .Remove (d .socketPath )
133133}
134134
135135func (d * Daemon ) acceptLoop () {
@@ -194,7 +194,7 @@ func (c *clientConn) cleanup() {
194194 delete (c .daemon .clients , c )
195195 c .daemon .clientsMu .Unlock ()
196196 close (c .sendCh )
197- c .conn .Close ()
197+ _ = c .conn .Close ()
198198}
199199
200200func (c * clientConn ) send (msg Message ) {
@@ -260,7 +260,7 @@ func (d *Daemon) handleStart(c *clientConn, msg Message) {
260260 if runner .IsPortInUse (svc .Port ) {
261261 pid , _ := runner .GetPortPID (svc .Port )
262262 if pid > 0 {
263- runner .KillProcess (pid )
263+ _ = runner .KillProcess (pid )
264264 }
265265 }
266266 }
@@ -328,7 +328,7 @@ func (d *Daemon) handleRestart(c *clientConn, msg Message) {
328328
329329 d .runner .RestartService (req .Service )
330330
331- resp , _ := NewMessage (MsgRestarted , RestartedResponse { Service : req . Service } )
331+ resp , _ := NewMessage (MsgRestarted , RestartedResponse ( req ) )
332332 c .send (resp )
333333}
334334
@@ -479,7 +479,7 @@ func (d *Daemon) StartServices(services []string, killPorts bool) error {
479479 if runner .IsPortInUse (svc .Port ) {
480480 pid , _ := runner .GetPortPID (svc .Port )
481481 if pid > 0 {
482- runner .KillProcess (pid )
482+ _ = runner .KillProcess (pid )
483483 }
484484 }
485485 }
0 commit comments