Fix spelling and golint errors. (#3266)

Fixes #3263
This commit is contained in:
Harshavardhana
2016-11-15 18:14:23 -08:00
committed by GitHub
parent 6512d9978e
commit 1b85302161
17 changed files with 90 additions and 89 deletions

View File

@@ -54,17 +54,17 @@ type config struct {
// type struct and contain a string type field called "Version".
func CheckData(data interface{}) error {
if !structs.IsStruct(data) {
return fmt.Errorf("Invalid argument type. Expecing \"struct\" type.")
return fmt.Errorf("Invalid argument type. Expecing \"struct\" type")
}
st := structs.New(data)
f, ok := st.FieldOk("Version")
if !ok {
return fmt.Errorf("Invalid type of struct argument. No [%s.Version] field found.", st.Name())
return fmt.Errorf("Invalid type of struct argument. No [%s.Version] field found", st.Name())
}
if f.Kind() != reflect.String {
return fmt.Errorf("Invalid type of struct argument. Expecting \"string\" type [%s.Version] field.", st.Name())
return fmt.Errorf("Invalid type of struct argument. Expecting \"string\" type [%s.Version] field", st.Name())
}
return nil
@@ -258,7 +258,7 @@ func (d *config) Load(filename string) error {
st := structs.New(d.data)
f, ok := st.FieldOk("Version")
if !ok {
return fmt.Errorf("Argument struct [%s] does not contain field \"Version\".", st.Name())
return fmt.Errorf("Argument struct [%s] does not contain field \"Version\"", st.Name())
}
err = json.Unmarshal(fileData, d.data)