Use errors.New() to output the error message and fix some typos

Signed-off-by: fate-grand-order <chenjg@harmonycloud.cn>
This commit is contained in:
fate-grand-order 2017-02-16 10:57:21 +08:00
parent 4f87c80073
commit 6a8e2ca84f
4 changed files with 7 additions and 6 deletions

View file

@ -1,6 +1,7 @@
package configuration
import (
"errors"
"fmt"
"io"
"io/ioutil"
@ -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"`
@ -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"`
}
@ -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
}