notify_socket.go: fix staticcheck warning

> notify_socket.go:44:24: ST1016: methods on the same type should have the same receiver name (seen 1x "n", 5x "s") (staticcheck)
> func (s *notifySocket) Close() error {
>                        ^

As reported by staticcheck from golangci-lint v2.0.0

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
This commit is contained in:
Kir Kolyshkin
2025-03-24 11:10:04 -07:00
parent dc7ede67fa
commit fdb691632d
+4 -4
View File
@@ -103,11 +103,11 @@ func (s *notifySocket) waitForContainer(container *libcontainer.Container) error
return s.run(state.InitProcessPid) return s.run(state.InitProcessPid)
} }
func (n *notifySocket) run(pid1 int) error { func (s *notifySocket) run(pid1 int) error {
if n.socket == nil { if s.socket == nil {
return nil return nil
} }
notifySocketHostAddr := net.UnixAddr{Name: n.host, Net: "unixgram"} notifySocketHostAddr := net.UnixAddr{Name: s.host, Net: "unixgram"}
client, err := net.DialUnix("unixgram", nil, &notifySocketHostAddr) client, err := net.DialUnix("unixgram", nil, &notifySocketHostAddr)
if err != nil { if err != nil {
return err return err
@@ -120,7 +120,7 @@ func (n *notifySocket) run(pid1 int) error {
go func() { go func() {
for { for {
buf := make([]byte, 4096) buf := make([]byte, 4096)
r, err := n.socket.Read(buf) r, err := s.socket.Read(buf)
if err != nil { if err != nil {
return return
} }