As originally designed in the issue discussion, a single function `NewCmdLock()` with a parameter to lock or unlock was proposed. However, after playing around with a couple different designs, it seems best to create two separate public functions and one private function to do the common work. Using two public functions seems to make sense because the api for locking is different from the api for unlocking. Therefore, the documentation for both are different and keeping them in separate functions would make it easier to maintain the documentation. |
||
|---|---|---|
| .. | ||
| lock.go | ||
| lock_test.go | ||