summaryrefslogtreecommitdiff
path: root/pkg/bindings
diff options
context:
space:
mode:
authoropenshift-ci[bot] <75433959+openshift-ci[bot]@users.noreply.github.com>2022-06-14 18:58:53 +0000
committerGitHub <noreply@github.com>2022-06-14 18:58:53 +0000
commite084f0ee1e1ded564110e84eefca9f18b5669adf (patch)
tree61903e09229733fbb6e4674ce983745268720703 /pkg/bindings
parent4018a9575e616ebcb3e5232c5d7c81ad6cadfc99 (diff)
parent41528739cef3d2b61e9b7437f6c557e60dbb79c0 (diff)
downloadpodman-e084f0ee1e1ded564110e84eefca9f18b5669adf.tar.gz
podman-e084f0ee1e1ded564110e84eefca9f18b5669adf.tar.bz2
podman-e084f0ee1e1ded564110e84eefca9f18b5669adf.zip
Merge pull request #14585 from Luap99/nolint
golangci-lint: enable nolintlint
Diffstat (limited to 'pkg/bindings')
-rw-r--r--pkg/bindings/connection.go5
-rw-r--r--pkg/bindings/containers/containers.go4
-rw-r--r--pkg/bindings/images/build.go2
-rw-r--r--pkg/bindings/images/build_unix.go2
4 files changed, 7 insertions, 6 deletions
diff --git a/pkg/bindings/connection.go b/pkg/bindings/connection.go
index 3739ec404..c21834e35 100644
--- a/pkg/bindings/connection.go
+++ b/pkg/bindings/connection.go
@@ -315,7 +315,8 @@ func unixClient(_url *url.URL) Connection {
return connection
}
-// DoRequest assembles the http request and returns the response
+// DoRequest assembles the http request and returns the response.
+// The caller must close the response body.
func (c *Connection) DoRequest(ctx context.Context, httpBody io.Reader, httpMethod, endpoint string, queryParams url.Values, headers http.Header, pathValues ...string) (*APIResponse, error) {
var (
err error
@@ -361,7 +362,7 @@ func (c *Connection) DoRequest(ctx context.Context, httpBody io.Reader, httpMeth
// Give the Do three chances in the case of a comm/service hiccup
for i := 1; i <= 3; i++ {
- response, err = c.Client.Do(req) // nolint
+ response, err = c.Client.Do(req) //nolint:bodyclose // The caller has to close the body.
if err == nil {
break
}
diff --git a/pkg/bindings/containers/containers.go b/pkg/bindings/containers/containers.go
index be421cc8b..2d3422411 100644
--- a/pkg/bindings/containers/containers.go
+++ b/pkg/bindings/containers/containers.go
@@ -25,7 +25,7 @@ var (
// the most recent number of containers. The pod and size booleans indicate that pod information and rootfs
// size information should also be included. Finally, the sync bool synchronizes the OCI runtime and
// container state.
-func List(ctx context.Context, options *ListOptions) ([]entities.ListContainer, error) { // nolint:typecheck
+func List(ctx context.Context, options *ListOptions) ([]entities.ListContainer, error) {
if options == nil {
options = new(ListOptions)
}
@@ -339,7 +339,7 @@ func Unpause(ctx context.Context, nameOrID string, options *UnpauseOptions) erro
// Wait blocks until the given container reaches a condition. If not provided, the condition will
// default to stopped. If the condition is stopped, an exit code for the container will be provided. The
// nameOrID can be a container name or a partial/full ID.
-func Wait(ctx context.Context, nameOrID string, options *WaitOptions) (int32, error) { // nolint
+func Wait(ctx context.Context, nameOrID string, options *WaitOptions) (int32, error) {
if options == nil {
options = new(WaitOptions)
}
diff --git a/pkg/bindings/images/build.go b/pkg/bindings/images/build.go
index 72fed6bd5..f14f866dd 100644
--- a/pkg/bindings/images/build.go
+++ b/pkg/bindings/images/build.go
@@ -621,7 +621,7 @@ func nTar(excludes []string, sources ...string) (io.ReadCloser, error) {
}
name := filepath.ToSlash(strings.TrimPrefix(path, s+string(filepath.Separator)))
- excluded, err := pm.Matches(name) // nolint:staticcheck
+ excluded, err := pm.Matches(name) //nolint:staticcheck
if err != nil {
return errors.Wrapf(err, "error checking if %q is excluded", name)
}
diff --git a/pkg/bindings/images/build_unix.go b/pkg/bindings/images/build_unix.go
index 32e2ba9af..07bb8cbcd 100644
--- a/pkg/bindings/images/build_unix.go
+++ b/pkg/bindings/images/build_unix.go
@@ -11,7 +11,7 @@ import (
func checkHardLink(fi os.FileInfo) (devino, bool) {
st := fi.Sys().(*syscall.Stat_t)
return devino{
- Dev: uint64(st.Dev), // nolint: unconvert
+ Dev: uint64(st.Dev), //nolint: unconvert
Ino: st.Ino,
}, st.Nlink > 1
}