etcdserver/api/v2store/store.go
func getCompareFailCause(n *node, which int, prevValue string, prevIndex uint64) string {
	switch which {
	case CompareIndexNotMatch:
		return fmt.Sprintf("[%v != %v]", prevIndex, n.ModifiedIndex)
	case CompareValueNotMatch:
		return fmt.Sprintf("[%v != %v]", prevValue, n.Value)
	default:
		return fmt.Sprintf("[%v != %v] [%v != %v]", prevValue, n.Value, prevIndex, n.ModifiedIndex)
	}
}
func getCompareFailCause(n *node, which int, prevValue string, prevIndex uint64) string {
	switch which {
	case CompareIndexNotMatch:
		return fmt.Sprintf("[%v != %v]", prevIndex, n.ModifiedIndex)
	case CompareValueNotMatch:
		return fmt.Sprintf("[%v != %v]", prevValue, n.Value)
	default:
		return fmt.Sprintf("[%v != %v] [%v != %v]", prevValue, n.Value, prevIndex, n.ModifiedIndex)
	}
}
func getCompareFailCause ( n * node , which int , prevValue string , prevIndex uint64 ) string { switch which { case CompareIndexNotMatch : return fmt . Sprintf ( " " , prevIndex , n . ModifiedIndex ) case CompareValueNotMatch : return fmt . Sprintf ( " " , prevValue , n . Value ) default : return fmt . Sprintf ( " " , prevValue , n . Value , prevIndex , n . ModifiedIndex ) } }
// returns user-readable cause of failed comparison
returns user - readable cause of failed comparison