Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
go-sectorbuilder
Commits
6e668981
Commit
6e668981
authored
Sep 16, 2019
by
laser
Browse files
refactor(names): drop Error prefix as per magik6k
parent
d6ca00c7
Changes
2
Hide whitespace changes
Inline
Side-by-side
sealed_sector_health/health.go
View file @
6e668981
...
@@ -5,19 +5,19 @@ package sealed_sector_health
...
@@ -5,19 +5,19 @@ package sealed_sector_health
type
Health
int
type
Health
int
const
(
const
(
Unknown
Health
=
iota
Unknown
Health
=
iota
Ok
// everything is fine
Ok
// everything is fine
Error
InvalidChecksum
// sector exists, but checksum is invalid
InvalidChecksum
// sector exists, but checksum is invalid
Error
InvalidLength
// sector exists, but length is incorrect
InvalidLength
// sector exists, but length is incorrect
Error
Missing
// sector no longer exists
Missing
// sector no longer exists
)
)
var
labels
=
[
...
]
string
{
var
labels
=
[
...
]
string
{
"Unknown"
,
"Unknown"
,
"Ok"
,
"Ok"
,
"
Error
InvalidChecksum"
,
"InvalidChecksum"
,
"
Error
InvalidLength"
,
"InvalidLength"
,
"
Error
Missing"
,
"Missing"
,
}
}
func
(
el
Health
)
String
()
string
{
func
(
el
Health
)
String
()
string
{
...
...
transforms.go
View file @
6e668981
...
@@ -136,11 +136,11 @@ func goSealedSectorHealth(health C.sector_builder_ffi_FFISealedSectorHealth) (se
...
@@ -136,11 +136,11 @@ func goSealedSectorHealth(health C.sector_builder_ffi_FFISealedSectorHealth) (se
case
C
.
Ok
:
case
C
.
Ok
:
return
sealed_sector_health
.
Ok
,
nil
return
sealed_sector_health
.
Ok
,
nil
case
C
.
ErrorInvalidChecksum
:
case
C
.
ErrorInvalidChecksum
:
return
sealed_sector_health
.
Error
InvalidChecksum
,
nil
return
sealed_sector_health
.
InvalidChecksum
,
nil
case
C
.
ErrorInvalidLength
:
case
C
.
ErrorInvalidLength
:
return
sealed_sector_health
.
Error
InvalidLength
,
nil
return
sealed_sector_health
.
InvalidLength
,
nil
case
C
.
ErrorMissing
:
case
C
.
ErrorMissing
:
return
sealed_sector_health
.
Error
Missing
,
nil
return
sealed_sector_health
.
Missing
,
nil
default
:
default
:
return
sealed_sector_health
.
Unknown
,
errors
.
Errorf
(
"unhandled sealed sector health: %v"
,
health
)
return
sealed_sector_health
.
Unknown
,
errors
.
Errorf
(
"unhandled sealed sector health: %v"
,
health
)
}
}
...
...
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