Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
531d3def
Commit
531d3def
authored
Aug 10, 2015
by
Alex Robinson
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #12482 from tmrts/refactor/iota
Refactor probe.Result enumeration
parents
11fcd3bb
16b44280
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
17 deletions
+5
-17
validator_test.go
pkg/apiserver/validator_test.go
+1
-1
probe.go
pkg/probe/probe.go
+4
-16
No files found.
pkg/apiserver/validator_test.go
View file @
531d3def
...
@@ -89,7 +89,7 @@ func TestValidate(t *testing.T) {
...
@@ -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
)
}
}
}
}
}
}
pkg/probe/probe.go
View file @
531d3def
...
@@ -16,22 +16,10 @@ limitations under the License.
...
@@ -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"
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment