func deleteRecursive(conn *zk.Conn, path string) { children, _, err := conn.Children(path) if err != nil { log.Printf("failed to get children %s: %s", path, err) return } for _, child := range children { deleteRecursive(conn, path+"/"+child) } err = conn.Delete(path, -1) if err != nil { log.Printf("failed to delete %s: %s", path, err) } }
func Delete(conn *zk.Conn, zkConf conf.Zookeeper, appId string) error { path := concatPath(zkConf.Path, validateAppId(appId)) return conn.Delete(path, -1) }