Skip to content

Commit

Permalink
Use errors.New() to output the error message and fix some typos
Browse files Browse the repository at this point in the history
Signed-off-by: fate-grand-order <[email protected]>
  • Loading branch information
fate-grand-order committed Feb 20, 2017
1 parent 4f87c80 commit 6a8e2ca
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion blobs.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ type BlobProvider interface {

// BlobServer can serve blobs via http.
type BlobServer interface {
// ServeBlob attempts to serve the blob, identifed by dgst, via http. The
// ServeBlob attempts to serve the blob, identified by dgst, via http. The
// service may decide to redirect the client elsewhere or serve the data
// directly.
//
Expand Down
2 changes: 1 addition & 1 deletion cmd/digest/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func init() {

func usage() {
fmt.Fprintf(os.Stderr, "usage: %s [files...]\n", os.Args[0])
fmt.Fprintf(os.Stderr, `
fmt.Fprint(os.Stderr, `
Calculate the digest of one or more input files, emitting the result
to standard out. If no files are provided, the digest of stdin will
be calculated.
Expand Down
7 changes: 4 additions & 3 deletions configuration/configuration.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package configuration

import (
"errors"
"fmt"
"io"
"io/ioutil"
Expand Down Expand Up @@ -132,7 +133,7 @@ type Configuration struct {

// HTTP2 configuration options
HTTP2 struct {
// Specifies wether the registry should disallow clients attempting
// Specifies whether the registry should disallow clients attempting
// to connect via http2. If set to true, only http/1.1 is supported.
Disabled bool `yaml:"disabled,omitempty"`
} `yaml:"http2,omitempty"`
Expand Down Expand Up @@ -235,7 +236,7 @@ type LogHook struct {
// Levels set which levels of log message will let hook executed.
Levels []string `yaml:"levels,omitempty"`

// MailOptions allows user to configurate email parameters.
// MailOptions allows user to configure email parameters.
MailOptions MailOptions `yaml:"options,omitempty"`
}

Expand Down Expand Up @@ -627,7 +628,7 @@ func Parse(rd io.Reader) (*Configuration, error) {
v0_1.Loglevel = Loglevel("info")
}
if v0_1.Storage.Type() == "" {
return nil, fmt.Errorf("No storage configuration provided")
return nil, errors.New("No storage configuration provided")
}
return (*Configuration)(v0_1), nil
}
Expand Down
2 changes: 1 addition & 1 deletion errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ func (err ErrManifestUnknownRevision) Error() string {
type ErrManifestUnverified struct{}

func (ErrManifestUnverified) Error() string {
return fmt.Sprintf("unverified manifest")
return "unverified manifest"
}

// ErrManifestVerification provides a type to collect errors encountered
Expand Down

0 comments on commit 6a8e2ca

Please sign in to comment.