syncdo useage package main import ( "fmt" "github.com/di3upham/syncdo" ) func main() { unlock := syncdo.KLock("f1") fmt.Println("hello world") unlock() } func fx() { defer syncdo.KLock("f1")() // function body }