Skip to content

Commit ca3b9b5

Browse files
committed
Run gofmt 1.19
Signed-off-by: Maksym Pavlenko <[email protected]>
1 parent 4a11a40 commit ca3b9b5

31 files changed

Lines changed: 206 additions & 192 deletions

File tree

cmd/ctr/commands/cni.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ const (
3636
CtrCniMetadataExtension = "ctr.cni-containerd.metadata"
3737
)
3838

39-
//ctr pass cni network metadata to containerd if ctr run use option of --cni
39+
// ctr pass cni network metadata to containerd if ctr run use option of --cni
4040
type NetworkMetaData struct {
4141
EnableCni bool
4242
}

content/local/store.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ import (
3434
"github.com/containerd/containerd/log"
3535
"github.com/sirupsen/logrus"
3636

37-
digest "github.com/opencontainers/go-digest"
37+
"github.com/opencontainers/go-digest"
3838
ocispec "github.com/opencontainers/image-spec/specs-go/v1"
3939
)
4040

@@ -643,7 +643,6 @@ func (s *store) ingestRoot(ref string) string {
643643
// - root: entire ingest directory
644644
// - ref: name of the starting ref, must be unique
645645
// - data: file where data is written
646-
//
647646
func (s *store) ingestPaths(ref string) (string, string, string) {
648647
var (
649648
fp = s.ingestRoot(ref)

contrib/fuzz/daemon.go

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,18 @@
22
// +build gofuzz
33

44
/*
5-
Copyright The containerd Authors.
6-
Licensed under the Apache License, Version 2.0 (the "License");
7-
you may not use this file except in compliance with the License.
8-
You may obtain a copy of the License at
9-
http://www.apache.org/licenses/LICENSE-2.0
10-
Unless required by applicable law or agreed to in writing, software
11-
distributed under the License is distributed on an "AS IS" BASIS,
12-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
See the License for the specific language governing permissions and
14-
limitations under the License.
5+
Copyright The containerd Authors.
6+
Licensed under the Apache License, Version 2.0 (the "License");
7+
you may not use this file except in compliance with the License.
8+
You may obtain a copy of the License at
9+
10+
http://www.apache.org/licenses/LICENSE-2.0
11+
12+
Unless required by applicable law or agreed to in writing, software
13+
distributed under the License is distributed on an "AS IS" BASIS,
14+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
See the License for the specific language governing permissions and
16+
limitations under the License.
1517
*/
1618
package fuzz
1719

filters/filter.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@
6565
// ```
6666
// name==foo,labels.bar
6767
// ```
68-
//
6968
package filters
7069

7170
import (

filters/parser.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ field := quoted | [A-Za-z] [A-Za-z0-9_]+
4545
operator := "==" | "!=" | "~="
4646
value := quoted | [^\s,]+
4747
quoted := <go string syntax>
48-
4948
*/
5049
func Parse(s string) (Filter, error) {
5150
// special case empty to match all

filters/quote.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@ var errQuoteSyntax = errors.New("quote syntax error")
3131
// or character literal represented by the string s.
3232
// It returns four values:
3333
//
34-
// 1) value, the decoded Unicode code point or byte value;
35-
// 2) multibyte, a boolean indicating whether the decoded character requires a multibyte UTF-8 representation;
36-
// 3) tail, the remainder of the string after the character; and
37-
// 4) an error that will be nil if the character is syntactically valid.
34+
// 1. value, the decoded Unicode code point or byte value;
35+
// 2. multibyte, a boolean indicating whether the decoded character requires a multibyte UTF-8 representation;
36+
// 3. tail, the remainder of the string after the character; and
37+
// 4. an error that will be nil if the character is syntactically valid.
3838
//
3939
// The second argument, quote, specifies the type of literal being parsed
4040
// and therefore which escaped quote character is permitted.

images/archive/importer.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,12 @@ func WithImportCompression() ImportOpt {
5555
}
5656

5757
// ImportIndex imports an index from a tar archive image bundle
58-
// - implements Docker v1.1, v1.2 and OCI v1.
59-
// - prefers OCI v1 when provided
60-
// - creates OCI index for Docker formats
61-
// - normalizes Docker references and adds as OCI ref name
62-
// e.g. alpine:latest -> docker.io/library/alpine:latest
63-
// - existing OCI reference names are untouched
58+
// - implements Docker v1.1, v1.2 and OCI v1.
59+
// - prefers OCI v1 when provided
60+
// - creates OCI index for Docker formats
61+
// - normalizes Docker references and adds as OCI ref name
62+
// e.g. alpine:latest -> docker.io/library/alpine:latest
63+
// - existing OCI reference names are untouched
6464
func ImportIndex(ctx context.Context, store content.Store, reader io.Reader, opts ...ImportOpt) (ocispec.Descriptor, error) {
6565
var (
6666
tr = tar.NewReader(reader)

integration/failpoint/cmd/cni-bridge-fp/main_linux.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import (
2020
"context"
2121
"encoding/json"
2222
"fmt"
23-
"io/ioutil"
23+
"io"
2424
"os"
2525
"path/filepath"
2626
"syscall"
@@ -168,7 +168,7 @@ func (c *failpointControl) updateTx(updateFn func(conf *failpointConf) error) er
168168
}
169169
defer unflock(f.Fd())
170170

171-
data, err := ioutil.ReadAll(f)
171+
data, err := io.ReadAll(f)
172172
if err != nil {
173173
return fmt.Errorf("failed to read failpoint setting %s: %w", c.confPath, err)
174174
}

integration/image_pull_timeout_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ func TestCRIImagePullTimeout(t *testing.T) {
6464

6565
// testCRIImagePullTimeoutByHoldingContentOpenWriter tests that
6666
//
67-
// It should not cancel if there is no active http requests.
67+
// It should not cancel if there is no active http requests.
6868
//
6969
// When there are several pulling requests for the same blob content, there
7070
// will only one active http request. It is singleflight. For the waiting pulling
@@ -197,7 +197,7 @@ func testCRIImagePullTimeoutByHoldingContentOpenWriter(t *testing.T) {
197197

198198
// testCRIImagePullTimeoutByNoDataTransferred tests that
199199
//
200-
// It should fail because there is no data transferred in open http request.
200+
// It should fail because there is no data transferred in open http request.
201201
//
202202
// The case uses the local mirror registry to forward request with circuit
203203
// breaker. If the local registry has transferred a certain amount of data in

metadata/buckets.go

Lines changed: 72 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
//
2727
// Generically, we try to do the following:
2828
//
29-
// <version>/<namespace>/<object>/<key> -> <field>
29+
// <version>/<namespace>/<object>/<key> -> <field>
3030
//
3131
// version: Currently, this is "v1". Additions can be made to v1 in a backwards
3232
// compatible way. If the layout changes, a new version must be made, along
@@ -46,77 +46,80 @@
4646
// the structure is changed in addition to adding a migration and incrementing
4747
// the database version.
4848
// Notes:
49-
// * `╘══*...*` refers to maps with arbitrary keys
50-
// * `version` is a key to a numeric value identifying the minor revisions
51-
// of schema version
52-
// * a namespace in a schema bucket cannot be named "version"
5349
//
54-
// └──v1 - Schema version bucket
50+
// - `╘══*...*` refers to maps with arbitrary keys
51+
//
52+
// - `version` is a key to a numeric value identifying the minor revisions
53+
// of schema version
54+
//
55+
// - a namespace in a schema bucket cannot be named "version"
56+
//
57+
// └──v1 - Schema version bucket
5558
// ├──version : <varint> - Latest version, see migrations
5659
// ╘══*namespace*
57-
// ├──labels
58-
// │  ╘══*key* : <string> - Label value
59-
// ├──image
60-
// │  ╘══*image name*
61-
// │   ├──createdat : <binary time> - Created at
62-
// │   ├──updatedat : <binary time> - Updated at
63-
// │   ├──target
64-
// │   │  ├──digest : <digest> - Descriptor digest
65-
// │   │  ├──mediatype : <string> - Descriptor media type
66-
// │   │  └──size : <varint> - Descriptor size
67-
// │   └──labels
68-
// │   ╘══*key* : <string> - Label value
69-
// ├──containers
70-
// │  ╘══*container id*
71-
// │   ├──createdat : <binary time> - Created at
72-
// │   ├──updatedat : <binary time> - Updated at
73-
// │   ├──spec : <binary> - Proto marshaled spec
74-
// │   ├──image : <string> - Image name
75-
// │   ├──snapshotter : <string> - Snapshotter name
76-
// │   ├──snapshotKey : <string> - Snapshot key
77-
// │   ├──runtime
78-
// │   │  ├──name : <string> - Runtime name
79-
// │   │  ├──extensions
80-
// │   │  │  ╘══*name* : <binary> - Proto marshaled extension
81-
// │   │  └──options : <binary> - Proto marshaled options
82-
// │   └──labels
83-
// │   ╘══*key* : <string> - Label value
84-
// ├──snapshots
85-
// │  ╘══*snapshotter*
86-
// │   ╘══*snapshot key*
87-
// │    ├──name : <string> - Snapshot name in backend
88-
// │   ├──createdat : <binary time> - Created at
89-
// │   ├──updatedat : <binary time> - Updated at
90-
// │    ├──parent : <string> - Parent snapshot name
91-
// │   ├──children
92-
// │   │  ╘══*snapshot key* : <nil> - Child snapshot reference
93-
// │   └──labels
94-
// │   ╘══*key* : <string> - Label value
95-
// ├──content
96-
// │  ├──blob
97-
// │  │ ╘══*blob digest*
98-
// │  │ ├──createdat : <binary time> - Created at
99-
// │  │ ├──updatedat : <binary time> - Updated at
100-
// │  │   ├──size : <varint> - Blob size
101-
// │  │ └──labels
102-
// │  │ ╘══*key* : <string> - Label value
103-
// │  └──ingests
104-
// │   ╘══*ingest reference*
105-
// │    ├──ref : <string> - Ingest reference in backend
106-
// │   ├──expireat : <binary time> - Time to expire ingest
107-
// │   └──expected : <digest> - Expected commit digest
108-
// └──leases
109-
// ╘══*lease id*
110-
//   ├──createdat : <binary time> - Created at
111-
// ├──labels
112-
// │ ╘══*key* : <string> - Label value
113-
//   ├──snapshots
114-
// │  ╘══*snapshotter*
115-
// │   ╘══*snapshot key* : <nil> - Snapshot reference
116-
//   ├──content
117-
// │  ╘══*blob digest* : <nil> - Content blob reference
118-
// └──ingests
119-
//   ╘══*ingest reference* : <nil> - Content ingest reference
60+
// ├──labels
61+
// │  ╘══*key* : <string> - Label value
62+
// ├──image
63+
// │  ╘══*image name*
64+
// │   ├──createdat : <binary time> - Created at
65+
// │   ├──updatedat : <binary time> - Updated at
66+
// │   ├──target
67+
// │   │  ├──digest : <digest> - Descriptor digest
68+
// │   │  ├──mediatype : <string> - Descriptor media type
69+
// │   │  └──size : <varint> - Descriptor size
70+
// │   └──labels
71+
// │   ╘══*key* : <string> - Label value
72+
// ├──containers
73+
// │  ╘══*container id*
74+
// │   ├──createdat : <binary time> - Created at
75+
// │   ├──updatedat : <binary time> - Updated at
76+
// │   ├──spec : <binary> - Proto marshaled spec
77+
// │   ├──image : <string> - Image name
78+
// │   ├──snapshotter : <string> - Snapshotter name
79+
// │   ├──snapshotKey : <string> - Snapshot key
80+
// │   ├──runtime
81+
// │   │  ├──name : <string> - Runtime name
82+
// │   │  ├──extensions
83+
// │   │  │  ╘══*name* : <binary> - Proto marshaled extension
84+
// │   │  └──options : <binary> - Proto marshaled options
85+
// │   └──labels
86+
// │   ╘══*key* : <string> - Label value
87+
// ├──snapshots
88+
// │  ╘══*snapshotter*
89+
// │   ╘══*snapshot key*
90+
// │    ├──name : <string> - Snapshot name in backend
91+
// │   ├──createdat : <binary time> - Created at
92+
// │   ├──updatedat : <binary time> - Updated at
93+
// │    ├──parent : <string> - Parent snapshot name
94+
// │   ├──children
95+
// │   │  ╘══*snapshot key* : <nil> - Child snapshot reference
96+
// │   └──labels
97+
// │   ╘══*key* : <string> - Label value
98+
// ├──content
99+
// │  ├──blob
100+
// │  │ ╘══*blob digest*
101+
// │  │ ├──createdat : <binary time> - Created at
102+
// │  │ ├──updatedat : <binary time> - Updated at
103+
// │  │   ├──size : <varint> - Blob size
104+
// │  │ └──labels
105+
// │  │ ╘══*key* : <string> - Label value
106+
// │  └──ingests
107+
// │   ╘══*ingest reference*
108+
// │    ├──ref : <string> - Ingest reference in backend
109+
// │   ├──expireat : <binary time> - Time to expire ingest
110+
// │   └──expected : <digest> - Expected commit digest
111+
// └──leases
112+
// ╘══*lease id*
113+
// ├──createdat : <binary time> - Created at
114+
// ├──labels
115+
// │ ╘══*key* : <string> - Label value
116+
// ├──snapshots
117+
// │  ╘══*snapshotter*
118+
// │   ╘══*snapshot key* : <nil> - Snapshot reference
119+
// ├──content
120+
// │  ╘══*blob digest* : <nil> - Content blob reference
121+
// └──ingests
122+
// ╘══*ingest reference* : <nil> - Content ingest reference
120123
package metadata
121124

122125
import (

0 commit comments

Comments
 (0)