Idiomatic 'iota' enumeration for serial error codes

This commit is contained in:
Cristian Maglie
2014-12-14 18:00:50 +01:00
parent 62b1977d7c
commit 83038c8ed9

View File

@@ -39,13 +39,13 @@ type SerialPortError struct {
}
const (
ERROR_PORT_BUSY = 1
ERROR_PORT_NOT_FOUND = 2
ERROR_INVALID_SERIAL_PORT = 3
ERROR_PERMISSION_DENIED = 4
ERROR_INVALID_PORT_SPEED = 5
ERROR_ENUMERATING_PORTS = 6
ERROR_OTHER = 99
ERROR_PORT_BUSY = iota
ERROR_PORT_NOT_FOUND
ERROR_INVALID_SERIAL_PORT
ERROR_PERMISSION_DENIED
ERROR_INVALID_PORT_SPEED
ERROR_ENUMERATING_PORTS
ERROR_OTHER
)
func (e SerialPortError) Error() string {