Update Lock Implementation using GUIDs
Looking at the implemention in lock.go and comparing with the Lock recipe from the Zookeeper recipes page, it appears that they now recomment creating lock nodes with a prefix of <GUID>-lock- instead of just lock- to handle a special case.
https://zookeeper.apache.org/doc/trunk/recipes.html#sc_recipes_Locks
Call create( ) with a pathname of "_locknode_/guid-lock-" and the sequence and ephemeral flags set. The guid is needed in case the create() result is missed. See the note below.
Does the current implementation in https://github.com/samuel/go-zookeeper/blob/master/zk/lock.go even follow one of the "official" lock recipes? There are no code comments indicating that as far as I can see. Would be good to know exactly what the goal was so that it's easier to decide what a bug is and what not.
@gkalele, #209 now allows for custom lock names based on a lock name builder. Does that fit your usecase?