device: remove deviceStateNew

It's never used and we won't have a use for it. Also, move to go-running
stringer, for those without GOPATHs.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
This commit is contained in:
Jason A. Donenfeld
2021-02-09 15:39:19 +01:00
parent a816e8511e
commit eaf664e4e9
3 changed files with 9 additions and 20 deletions

View File

@@ -91,20 +91,18 @@ type Device struct {
}
// deviceState represents the state of a Device.
// There are four states: new, down, up, closed.
// However, state new should never be observable.
// There are three states: down, up, closed.
// Transitions:
//
// new -> down -----+
// ↑↓ ↓
// up -> closed
// down -----+
// ↑↓ ↓
// up -> closed
//
type deviceState uint32
//go:generate stringer -type deviceState -trimprefix=deviceState
//go:generate go run golang.org/x/tools/cmd/stringer -type deviceState -trimprefix=deviceState
const (
deviceStateNew deviceState = iota
deviceStateDown
deviceStateDown deviceState = iota
deviceStateUp
deviceStateClosed
)