various cleanups to address linter issues

Signed-off-by: Dominik Süß <dominik@suess.wtf>
This commit is contained in:
Dominik Süß
2018-10-13 21:14:03 +02:00
parent 398f670bcb
commit 0b412e9482
16 changed files with 23 additions and 78 deletions
+5 -5
View File
@@ -37,8 +37,8 @@ func newNotifySocket(context *cli.Context, notifySocketHost string, id string) *
return notifySocket
}
func (ns *notifySocket) Close() error {
return ns.socket.Close()
func (s *notifySocket) Close() error {
return s.socket.Close()
}
// If systemd is supporting sd_notify protocol, this function will add support
@@ -66,16 +66,16 @@ func (s *notifySocket) setupSocket() error {
// pid1 must be set only with -d, as it is used to set the new process as the main process
// for the service in systemd
func (notifySocket *notifySocket) run(pid1 int) {
func (s *notifySocket) run(pid1 int) {
buf := make([]byte, 512)
notifySocketHostAddr := net.UnixAddr{Name: notifySocket.host, Net: "unixgram"}
notifySocketHostAddr := net.UnixAddr{Name: s.host, Net: "unixgram"}
client, err := net.DialUnix("unixgram", nil, &notifySocketHostAddr)
if err != nil {
logrus.Error(err)
return
}
for {
r, err := notifySocket.socket.Read(buf)
r, err := s.socket.Read(buf)
if err != nil {
break
}