From e0521d2d010450d29c9df75c51eae357494b02b3 Mon Sep 17 00:00:00 2001 From: bin liu Date: Fri, 17 Apr 2015 12:39:52 +0000 Subject: [PATCH] fix some typos in source comments Signed-off-by: bin liu --- digest/tarsum.go | 4 ++-- doc.go | 2 +- notifications/sinks.go | 6 +++--- registry/auth/auth.go | 4 ++-- registry/auth/token/util.go | 2 +- registry/storage/driver/ipc/server.go | 6 +++--- registry/storage/driver/testsuites/testsuites.go | 2 +- registry/storage/layer_test.go | 2 +- registry/storage/layerwriter.go | 2 +- registry/storage/paths.go | 2 +- 10 files changed, 16 insertions(+), 16 deletions(-) diff --git a/digest/tarsum.go b/digest/tarsum.go index acf878b6..702d7dc3 100644 --- a/digest/tarsum.go +++ b/digest/tarsum.go @@ -6,10 +6,10 @@ import ( "regexp" ) -// TarSumRegexp defines a reguler expression to match tarsum identifiers. +// TarSumRegexp defines a regular expression to match tarsum identifiers. var TarsumRegexp = regexp.MustCompile("tarsum(?:.[a-z0-9]+)?\\+[a-zA-Z0-9]+:[A-Fa-f0-9]+") -// TarsumRegexpCapturing defines a reguler expression to match tarsum identifiers with +// TarsumRegexpCapturing defines a regular expression to match tarsum identifiers with // capture groups corresponding to each component. var TarsumRegexpCapturing = regexp.MustCompile("(tarsum)(.([a-z0-9]+))?\\+([a-zA-Z0-9]+):([A-Fa-f0-9]+)") diff --git a/doc.go b/doc.go index 9b981f7d..bdd8cb70 100644 --- a/doc.go +++ b/doc.go @@ -2,6 +2,6 @@ // docker distribution. The goal is to allow users to reliably package, ship // and store content related to docker images. // -// This is currently a work in progress. More details are availalbe in the +// This is currently a work in progress. More details are available in the // README.md. package distribution diff --git a/notifications/sinks.go b/notifications/sinks.go index 2bf63e2d..dda4a565 100644 --- a/notifications/sinks.go +++ b/notifications/sinks.go @@ -220,7 +220,7 @@ type retryingSink struct { sink Sink closed bool - // circuit breaker hueristics + // circuit breaker heuristics failures struct { threshold int recent int @@ -317,7 +317,7 @@ func (rs *retryingSink) wait(backoff time.Duration) { time.Sleep(backoff) } -// reset marks a succesful call. +// reset marks a successful call. func (rs *retryingSink) reset() { rs.failures.recent = 0 rs.failures.last = time.Time{} @@ -330,7 +330,7 @@ func (rs *retryingSink) failure() { } // proceed returns true if the call should proceed based on circuit breaker -// hueristics. +// heuristics. func (rs *retryingSink) proceed() bool { return rs.failures.recent < rs.failures.threshold || time.Now().UTC().After(rs.failures.last.Add(rs.failures.backoff)) diff --git a/registry/auth/auth.go b/registry/auth/auth.go index a8499342..ec82b469 100644 --- a/registry/auth/auth.go +++ b/registry/auth/auth.go @@ -3,7 +3,7 @@ // An access controller has a simple interface with a single `Authorized` // method which checks that a given request is authorized to perform one or // more actions on one or more resources. This method should return a non-nil -// error if the requset is not authorized. +// error if the request is not authorized. // // An implementation registers its access controller by name with a constructor // which accepts an options map for configuring the access controller. @@ -50,7 +50,7 @@ type Resource struct { } // Access describes a specific action that is -// requested or allowed for a given recource. +// requested or allowed for a given resource. type Access struct { Resource Action string diff --git a/registry/auth/token/util.go b/registry/auth/token/util.go index bf3e01e8..d7f95be4 100644 --- a/registry/auth/token/util.go +++ b/registry/auth/token/util.go @@ -7,7 +7,7 @@ import ( ) // joseBase64UrlEncode encodes the given data using the standard base64 url -// encoding format but with all trailing '=' characters ommitted in accordance +// encoding format but with all trailing '=' characters omitted in accordance // with the jose specification. // http://tools.ietf.org/html/draft-ietf-jose-json-web-signature-31#section-2 func joseBase64UrlEncode(b []byte) string { diff --git a/registry/storage/driver/ipc/server.go b/registry/storage/driver/ipc/server.go index 4c6f1d4d..1752f12b 100644 --- a/registry/storage/driver/ipc/server.go +++ b/registry/storage/driver/ipc/server.go @@ -101,7 +101,7 @@ func handleRequest(driver storagedriver.StorageDriver, request Request) { } case "ReadStream": path, _ := request.Parameters["Path"].(string) - // Depending on serialization method, Offset may be convereted to any int/uint type + // Depending on serialization method, Offset may be converted to any int/uint type offset := reflect.ValueOf(request.Parameters["Offset"]).Convert(reflect.TypeOf(int64(0))).Int() reader, err := driver.ReadStream(path, offset) var response ReadStreamResponse @@ -116,9 +116,9 @@ func handleRequest(driver storagedriver.StorageDriver, request Request) { } case "WriteStream": path, _ := request.Parameters["Path"].(string) - // Depending on serialization method, Offset may be convereted to any int/uint type + // Depending on serialization method, Offset may be converted to any int/uint type offset := reflect.ValueOf(request.Parameters["Offset"]).Convert(reflect.TypeOf(int64(0))).Int() - // Depending on serialization method, Size may be convereted to any int/uint type + // Depending on serialization method, Size may be converted to any int/uint type size := reflect.ValueOf(request.Parameters["Size"]).Convert(reflect.TypeOf(int64(0))).Int() reader, _ := request.Parameters["Reader"].(io.ReadCloser) err := driver.WriteStream(path, offset, size, reader) diff --git a/registry/storage/driver/testsuites/testsuites.go b/registry/storage/driver/testsuites/testsuites.go index 74ddab6f..9f387a62 100644 --- a/registry/storage/driver/testsuites/testsuites.go +++ b/registry/storage/driver/testsuites/testsuites.go @@ -435,7 +435,7 @@ func (suite *DriverSuite) testContinueStreamAppend(c *check.C, chunkSize int64) c.Assert(err, check.IsNil) c.Assert(received, check.DeepEquals, fullContents) - // Writing past size of file extends file (no offest error). We would like + // Writing past size of file extends file (no offset error). We would like // to write chunk 4 one chunk length past chunk 3. It should be successful // and the resulting file will be 5 chunks long, with a chunk of all // zeros. diff --git a/registry/storage/layer_test.go b/registry/storage/layer_test.go index e225d068..f25018da 100644 --- a/registry/storage/layer_test.go +++ b/registry/storage/layer_test.go @@ -336,7 +336,7 @@ func seekerSize(seeker io.ReadSeeker) (int64, error) { // createTestLayer creates a simple test layer in the provided driver under // tarsum dgst, returning the sha256 digest location. This is implemented -// peicemeal and should probably be replaced by the uploader when it's ready. +// piecemeal and should probably be replaced by the uploader when it's ready. func writeTestLayer(driver storagedriver.StorageDriver, pathMapper *pathMapper, name string, dgst digest.Digest, content io.Reader) (digest.Digest, error) { h := sha256.New() rd := io.TeeReader(content, h) diff --git a/registry/storage/layerwriter.go b/registry/storage/layerwriter.go index 1e5ea918..0305d011 100644 --- a/registry/storage/layerwriter.go +++ b/registry/storage/layerwriter.go @@ -182,7 +182,7 @@ func (lw *layerWriter) resumeHashAt(offset int64) error { } if offset == int64(lw.resumableDigester.Len()) { - // State of digester is already at the requseted offset. + // State of digester is already at the requested offset. return nil } diff --git a/registry/storage/paths.go b/registry/storage/paths.go index 7aeff6e4..fe648f51 100644 --- a/registry/storage/paths.go +++ b/registry/storage/paths.go @@ -387,7 +387,7 @@ type layerLinkPathSpec struct { func (layerLinkPathSpec) pathSpec() {} // blobAlgorithmReplacer does some very simple path sanitization for user -// input. Mostly, this is to provide some heirachry for tarsum digests. Paths +// input. Mostly, this is to provide some hierarchy for tarsum digests. Paths // should be "safe" before getting this far due to strict digest requirements // but we can add further path conversion here, if needed. var blobAlgorithmReplacer = strings.NewReplacer(