contrib/recipes/key.go
func newUniqueEphemeralKV(s *concurrency.Session, prefix, val string) (ek *EphemeralKV, err error) {
	for {
		newKey := fmt.Sprintf("%s/%v", prefix, time.Now().UnixNano())
		ek, err = newEphemeralKV(s, newKey, val)
		if err == nil || err != ErrKeyExists {
			break
		}
	}
	return ek, err
}
func newUniqueEphemeralKV(s *concurrency.Session, prefix, val string) (ek *EphemeralKV, err error) {
	for {
		newKey := fmt.Sprintf("%s/%v", prefix, time.Now().UnixNano())
		ek, err = newEphemeralKV(s, newKey, val)
		if err == nil || err != ErrKeyExists {
			break
		}
	}
	return ek, err
}
func newUniqueEphemeralKV ( s * concurrency . Session , prefix , val string ) ( ek * EphemeralKV , err error ) { for { newKey := fmt . Sprintf ( " " , prefix , time . Now ( ) . UnixNano ( ) ) ek , err = newEphemeralKV ( s , newKey , val ) if err == nil || err != ErrKeyExists { break } } return ek , err }
// newUniqueEphemeralKV creates a new unique key/value pair associated with a session lease
newUniqueEphemeralKV creates a new unique key / value pair associated with a session lease