File tree Expand file tree Collapse file tree 2 files changed +3
-20
lines changed Expand file tree Collapse file tree 2 files changed +3
-20
lines changed Original file line number Diff line number Diff line change @@ -99,12 +99,7 @@ func recvPidfd(socketFile string) (*os.File, error) {
9999 }
100100 defer conn .Close ()
101101
102- unixconn , ok := conn .(* net.UnixConn )
103- if ! ok {
104- return nil , errors .New ("failed to cast to unixconn" )
105- }
106-
107- socket , err := unixconn .File ()
102+ socket , err := conn .(* net.UnixConn ).File ()
108103 if err != nil {
109104 return nil , err
110105 }
Original file line number Diff line number Diff line change @@ -85,13 +85,7 @@ func handleSingle(path string, noStdin bool) error {
8585 // Close ln, to allow for other instances to take over.
8686 ln .Close ()
8787
88- // Get the fd of the connection.
89- unixconn , ok := conn .(* net.UnixConn )
90- if ! ok {
91- return errors .New ("failed to cast to unixconn" )
92- }
93-
94- socket , err := unixconn .File ()
88+ socket , err := conn .(* net.UnixConn ).File ()
9589 if err != nil {
9690 return err
9791 }
@@ -158,13 +152,7 @@ func handleNull(path string) error {
158152 // Don't leave references lying around.
159153 defer conn .Close ()
160154
161- // Get the fd of the connection.
162- unixconn , ok := conn .(* net.UnixConn )
163- if ! ok {
164- return
165- }
166-
167- socket , err := unixconn .File ()
155+ socket , err := conn .(* net.UnixConn ).File ()
168156 if err != nil {
169157 return
170158 }
You can’t perform that action at this time.
0 commit comments