Unverified Commit c808a267 authored by Jakub Sztandera's avatar Jakub Sztandera
Browse files

Use go generate and stringer for sealing_state.String()



To run the generator `go generate ./sealing_state`.
To install `stringer`: `go get golang.org/x/tools/cmd/stringer`.

Also run `go mod tidy`.

License: MIT
Signed-off-by: default avatarJakub Sztandera <kubuxu@protocol.ai>
parent 692725ff
......@@ -3,21 +3,10 @@ module github.com/filecoin-project/go-sectorbuilder
go 1.12
require (
github.com/golangci/golangci-lint v1.17.1 // indirect
github.com/hashicorp/golang-lru v0.5.3 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/ipfs/go-log v0.0.1
github.com/neelance/parallel v0.0.0-20160708114440-4de9ce63d14c // indirect
github.com/opentracing/basictracer-go v1.0.0 // indirect
github.com/pkg/errors v0.8.1
github.com/prometheus/client_golang v1.1.0 // indirect
github.com/slimsag/godocmd v0.0.0-20161025000126-a1005ad29fe3 // indirect
github.com/sourcegraph/ctxvfs v0.0.0-20180418081416-2b65f1b1ea81 // indirect
github.com/sourcegraph/go-langserver v2.0.0+incompatible // indirect
github.com/sourcegraph/jsonrpc2 v0.0.0-20190106185902-35a74f039c6a // indirect
github.com/stretchr/testify v1.3.0
golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4 // indirect
golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7 // indirect
golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a // indirect
golang.org/x/text v0.3.2 // indirect
golang.org/x/tools v0.0.0-20190813142322-97f12d73768f // indirect
)
This diff is collapsed.
package sealing_state
//go:generate stringer -type=State
// State communicates the state of the sector with respect to sealing.
type State int
......@@ -12,17 +14,3 @@ const (
Paused // sector sealing has been paused and can be resumed
ReadyForSealing // staged sector is full and is ready to seal
)
var labels = [...]string{
"Unknown",
"Pending",
"Failed",
"Sealing",
"Sealed",
"Paused",
"ReadyForSealing",
}
func (el State) String() string {
return labels[el]
}
// Code generated by "stringer -type=State"; DO NOT EDIT.
package sealing_state
import "strconv"
func _() {
// An "invalid array index" compiler error signifies that the constant values have changed.
// Re-run the stringer command to generate them again.
var x [1]struct{}
_ = x[Unknown-0]
_ = x[Pending-1]
_ = x[Failed-2]
_ = x[Sealing-3]
_ = x[Sealed-4]
_ = x[Paused-5]
_ = x[ReadyForSealing-6]
}
const _State_name = "UnknownPendingFailedSealingSealedPausedReadyForSealing"
var _State_index = [...]uint8{0, 7, 14, 20, 27, 33, 39, 54}
func (i State) String() string {
if i < 0 || i >= State(len(_State_index)-1) {
return "State(" + strconv.FormatInt(int64(i), 10) + ")"
}
return _State_name[_State_index[i]:_State_index[i+1]]
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment