mirror of
https://github.com/opencontainers/runc.git
synced 2026-07-10 21:53:57 +08:00
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:
+4
-4
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user