mistifyio/go-zfs

Use string constants for zpool health states

mdlayher opened this issue · 2 comments

This could allow for easier checks of common zpool states, and for more specific logic in the case of a pool which is degraded, offline, etc.

http://play.golang.org/p/_bSlCjlTWZ

Perhaps the zpool.Healthy() method is not entirely necessary, but it's a lot nicer than doing if z.Health == "ONLINE".

👍 I wonder should we name them ZPoolOnline rather than just PoolOnline - no strong feelings either way.

For consistency, that is probably a good idea. I would think ZpoolOnline as well, to match the Zpool struct.