From c33184345724526a2aa2b5eef9ead2beb1a7392f Mon Sep 17 00:00:00 2001 From: Kir Kolyshkin Date: Mon, 24 Mar 2025 11:10:04 -0700 Subject: [PATCH] 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 (cherry picked from commit fdb691632d4ed319f8d0478beb15a58a5cb0e6f3) Signed-off-by: lifubang --- notify_socket.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/notify_socket.go b/notify_socket.go index 34c31cc3f..50920c2f9 100644 --- a/notify_socket.go +++ b/notify_socket.go @@ -103,11 +103,11 @@ func (s *notifySocket) waitForContainer(container *libcontainer.Container) error return s.run(state.InitProcessPid) } -func (n *notifySocket) run(pid1 int) error { - if n.socket == nil { +func (s *notifySocket) run(pid1 int) error { + if s.socket == 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, ¬ifySocketHostAddr) if err != nil { return err @@ -120,7 +120,7 @@ func (n *notifySocket) run(pid1 int) error { go func() { for { buf := make([]byte, 4096) - r, err := n.socket.Read(buf) + r, err := s.socket.Read(buf) if err != nil { return }