Merge pull request #12482 from tmrts/refactor/iota

Refactor probe.Result enumeration
This commit is contained in:
Alex Robinson 2015-08-10 13:20:04 -07:00
commit 531d3def98
2 changed files with 5 additions and 17 deletions

View File

@ -89,7 +89,7 @@ func TestValidate(t *testing.T) {
t.Errorf("expected empty string, got %s", status) t.Errorf("expected empty string, got %s", status)
} }
if status != test.expectedStatus { if status != test.expectedStatus {
t.Errorf("expected %s, got %s", test.expectedStatus.String(), status.String()) t.Errorf("expected %s, got %s", test.expectedStatus, status)
} }
} }
} }

View File

@ -16,22 +16,10 @@ limitations under the License.
package probe package probe
type Result int type Result string
// Status values must be one of these constants.
const ( const (
Success Result = iota Success Result = "success"
Failure Failure Result = "failure"
Unknown Unknown Result = "unknown"
) )
func (s Result) String() string {
switch s {
case Success:
return "success"
case Failure:
return "failure"
default:
return "unknown"
}
}