Skip to content

Commit 2bc9768

Browse files
committed
correct remaining lint issues
Signed-off-by: Allen Davis <hoplin44@proton.me>
1 parent c585f05 commit 2bc9768

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

sources/docker.go

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,9 @@ import (
88
"path/filepath"
99

1010
imgspec "github.com/opencontainers/image-spec/specs-go/v1"
11-
1211
"github.com/opencontainers/umoci/oci/cas/dir"
1312
"github.com/opencontainers/umoci/oci/casext"
1413
"github.com/opencontainers/umoci/oci/layer"
15-
1614
"go.podman.io/image/v5/copy"
1715
"go.podman.io/image/v5/docker/reference"
1816
"go.podman.io/image/v5/oci/layout"
@@ -48,11 +46,13 @@ func (s *docker) Run() error {
4846

4947
// Docker references with both a tag and digest are currently not supported
5048
var imageTag string
51-
if digested, ok := imageRef.(reference.Digested); ok {
49+
digested, ok := imageRef.(reference.Digested)
50+
if ok {
5251
imageTag = digested.Digest().String()
5352
} else {
5453
imageTag = "latest"
55-
if tagged, ok := imageRef.(reference.NamedTagged); ok {
54+
tagged, ok := imageRef.(reference.NamedTagged)
55+
if ok {
5656
imageTag = tagged.Tag()
5757
}
5858
}
@@ -71,9 +71,11 @@ func (s *docker) Run() error {
7171
systemCtx := &types.SystemContext{
7272
DockerInsecureSkipTLSVerify: types.OptionalBoolFalse,
7373
}
74+
7475
policy := &signature.Policy{
7576
Default: []signature.PolicyRequirement{signature.NewPRInsecureAcceptAnything()},
7677
}
78+
7779
policyCtx, err := signature.NewPolicyContext(policy)
7880
if err != nil {
7981
return fmt.Errorf("Failed to create policy context: %w", err)
@@ -108,7 +110,8 @@ func (s *docker) Run() error {
108110
defer func() { _ = engine.Close() }()
109111

110112
var manifest imgspec.Manifest
111-
if err := json.Unmarshal(copiedManifest, &manifest); err != nil {
113+
err = json.Unmarshal(copiedManifest, &manifest)
114+
if err != nil {
112115
return fmt.Errorf("Failed to parse manifest: %w", err)
113116
}
114117

0 commit comments

Comments
 (0)