Merge pull request #11613 from knweiss/gosimple

Code simplification (gosimple)
This commit is contained in:
Carl Bergquist
2018-04-17 22:40:40 +02:00
committed by GitHub
45 changed files with 89 additions and 174 deletions
+2 -2
View File
@@ -48,9 +48,9 @@ func (r *RoleType) UnmarshalJSON(data []byte) error {
*r = RoleType(str)
if (*r).IsValid() == false {
if !(*r).IsValid() {
if (*r) != "" {
return errors.New(fmt.Sprintf("JSON validation error: invalid role value: %s", *r))
return fmt.Errorf("JSON validation error: invalid role value: %s", *r)
}
*r = ROLE_VIEWER