mirror of
https://code.forgejo.org/forgejo/runner.git
synced 2025-09-15 18:57:01 +00:00
chore: enable staticcheck (#196)
Fix places where deprecated functions/types were used. Reviewed-on: https://code.forgejo.org/forgejo/act/pulls/196 Reviewed-by: earl-warren <earl-warren@noreply.code.forgejo.org> Co-authored-by: Gusted <postmaster@gusted.xyz> Co-committed-by: Gusted <postmaster@gusted.xyz>
This commit is contained in:
parent
6e4a3b5127
commit
b1ea5424b9
8 changed files with 41 additions and 41 deletions
|
@ -6,8 +6,8 @@ import (
|
|||
"context"
|
||||
"fmt"
|
||||
|
||||
cerrdefs "github.com/containerd/errdefs"
|
||||
"github.com/docker/docker/api/types/image"
|
||||
"github.com/docker/docker/client"
|
||||
)
|
||||
|
||||
// ImageExistsLocally returns a boolean indicating if an image with the
|
||||
|
@ -19,8 +19,8 @@ func ImageExistsLocally(ctx context.Context, imageName string, platform string)
|
|||
}
|
||||
defer cli.Close()
|
||||
|
||||
inspectImage, _, err := cli.ImageInspectWithRaw(ctx, imageName)
|
||||
if client.IsErrNotFound(err) {
|
||||
inspectImage, err := cli.ImageInspect(ctx, imageName)
|
||||
if cerrdefs.IsNotFound(err) {
|
||||
return false, nil
|
||||
} else if err != nil {
|
||||
return false, err
|
||||
|
@ -43,7 +43,7 @@ func RemoveImage(ctx context.Context, imageName string, force bool, pruneChildre
|
|||
defer cli.Close()
|
||||
|
||||
inspectImage, err := cli.ImageInspect(ctx, imageName)
|
||||
if client.IsErrNotFound(err) {
|
||||
if cerrdefs.IsNotFound(err) {
|
||||
return false, nil
|
||||
} else if err != nil {
|
||||
return false, err
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue