@@ -98,7 +98,9 @@ var connectionFactories = map[string]func(_url *url.URL, uri string, identity st
9898// For example tcp://localhost:<port>
9999// or unix:///run/podman/podman.sock
100100// or ssh://<user>@<host>[:port]/run/podman/podman.sock
101- func NewConnectionWithIdentity (ctx context.Context , uri string , identity string , machine bool ) (context.Context , error ) {
101+ func NewConnectionWithIdentity (ctx context.Context , uri string , identity string , machine bool ) (
102+ context.Context , error ,
103+ ) {
102104 var err error
103105 if v , found := os .LookupEnv ("CONTAINER_HOST" ); found && uri == "" {
104106 uri = v
@@ -228,13 +230,15 @@ func sshClient(_url *url.URL, uri string, identity string, machine bool) (Connec
228230 logrus .Debugf (" IdentityFile: %q" , identity )
229231 }
230232 }
231- conn , err := ssh .Dial (& ssh.ConnectionDialOptions {
232- Host : uri ,
233- Identity : identity ,
234- User : userinfo ,
235- Port : port ,
236- InsecureIsMachineConnection : machine ,
237- }, ssh .GolangMode )
233+ conn , err := ssh .Dial (
234+ & ssh.ConnectionDialOptions {
235+ Host : uri ,
236+ Identity : identity ,
237+ User : userinfo ,
238+ Port : port ,
239+ InsecureIsMachineConnection : machine ,
240+ }, ssh .GolangMode ,
241+ )
238242 if err != nil {
239243 return connection , newConnectError (err )
240244 }
@@ -248,7 +252,8 @@ func sshClient(_url *url.URL, uri string, identity string, machine bool) (Connec
248252 var b bytes.Buffer
249253 session .Stdout = & b
250254 if err := session .Run (
251- "podman info --format '{{.Host.RemoteSocket.Path}}'" ); err != nil {
255+ "podman info --format '{{.Host.RemoteSocket.Path}}'" ,
256+ ); err != nil {
252257 return connection , err
253258 }
254259 val := strings .TrimSuffix (b .String (), "\n " )
@@ -339,8 +344,10 @@ func pingNewConnection(ctx context.Context) (*semver.Version, error) {
339344 // Server's job when Client version is equal or older
340345 return & versionSrv , nil
341346 case 1 :
342- return nil , fmt .Errorf ("server API version is too old. Client %q server %q" ,
343- version.APIVersion [version.Libpod ][version.MinimalAPI ].String (), versionSrv .String ())
347+ return nil , fmt .Errorf (
348+ "server API version is too old. Client %q server %q" ,
349+ version.APIVersion [version.Libpod ][version.MinimalAPI ].String (), versionSrv .String (),
350+ )
344351 }
345352 }
346353 return nil , fmt .Errorf ("ping response was %d" , response .StatusCode )
@@ -366,7 +373,10 @@ func unixClient(_url *url.URL, uri string, _ string, _ bool) (Connection, error)
366373
367374// DoRequest assembles the http request and returns the response.
368375// The caller must close the response body.
369- func (c * Connection ) DoRequest (ctx context.Context , httpBody io.Reader , httpMethod , endpoint string , queryParams url.Values , headers http.Header , pathValues ... string ) (* APIResponse , error ) {
376+ func (c * Connection ) DoRequest (
377+ ctx context.Context , httpBody io.Reader , httpMethod , endpoint string , queryParams url.Values , headers http.Header ,
378+ pathValues ... string ,
379+ ) (* APIResponse , error ) {
370380 var (
371381 err error
372382 response * http.Response
0 commit comments