summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@sbcglobal.net>2015-11-23 03:18:23 -0500
committerLuke Shumaker <lukeshu@sbcglobal.net>2015-11-23 03:18:23 -0500
commit89efdfbee5f9a22f9dd1083f7a383daba54d4f12 (patch)
tree588317bc3a5f5c37cd103285a162fe28b8782490
parent8953b22526dea1af6458f3de17ec96ecf3c417e0 (diff)
gometalinter
-rw-r--r--sd_daemon/listen_fds.go8
-rw-r--r--sd_daemon/notify.go4
2 files changed, 6 insertions, 6 deletions
diff --git a/sd_daemon/listen_fds.go b/sd_daemon/listen_fds.go
index 0ddf0d0..e6a81ca 100644
--- a/sd_daemon/listen_fds.go
+++ b/sd_daemon/listen_fds.go
@@ -25,8 +25,8 @@ import (
//#define SD_LISTEN_FDS_START 3
import "C"
-// Returns a list of file descriptors passed in by the service manager
-// as part of the socket-based activation logic.
+// ListenFds returns a list of file descriptors passed in by the
+// service manager as part of the socket-based activation logic.
//
// If unsetEnv is true, then (regarless of whether the function call
// itself succeeds or not) it will unset the environmental variables
@@ -36,8 +36,8 @@ import "C"
// In the case of an error, this function returns nil.
func ListenFds(unsetEnv bool) []*os.File {
if unsetEnv {
- defer os.Unsetenv("LISTEN_PID")
- defer os.Unsetenv("LISTEN_FDS")
+ defer func() { _ = os.Unsetenv("LISTEN_PID") }()
+ defer func() { _ = os.Unsetenv("LISTEN_FDS") }()
}
pid, err := strconv.Atoi(os.Getenv("LISTEN_PID"))
diff --git a/sd_daemon/notify.go b/sd_daemon/notify.go
index 8fce6da..b159a22 100644
--- a/sd_daemon/notify.go
+++ b/sd_daemon/notify.go
@@ -40,7 +40,7 @@ var errNotifyNoSocket = errors.New("No socket")
// assignments.
func Notify(unsetEnv bool, state string) error {
if unsetEnv {
- defer os.Unsetenv("NOTIFY_SOCKET")
+ defer func() { _ = os.Unsetenv("NOTIFY_SOCKET") }()
}
socketAddr := &net.UnixAddr{
@@ -56,7 +56,7 @@ func Notify(unsetEnv bool, state string) error {
if err != nil {
return err
}
- defer conn.Close()
+ defer func() { _ = conn.Close() }()
_, err = conn.Write([]byte(state))
return err