Skip to content

Instantly share code, notes, and snippets.

View zhangguanzhang's full-sized avatar
🎯
I may be slow to respond.

zhangguanzhang zhangguanzhang

🎯
I may be slow to respond.
View GitHub Profile
@zhangguanzhang
zhangguanzhang / rbac_casbin.go
Last active July 14, 2020 08:35
casbin group demo
package main
import (
"fmt"
"log"
"github.com/casbin/casbin/v2"
gormadapter "github.com/casbin/gorm-adapter/v2"
"github.com/gin-gonic/gin"
_ "github.com/go-sql-driver/mysql"
@zhangguanzhang
zhangguanzhang / gist:791c484f6137f8deaed473a3857219ee
Last active May 17, 2020 11:38
golang Remove the specified repeated string
package main
import (
"fmt"
)
func main() {
s := `aaabccaad`
u := "a"
fmt.Printf("%s %s ===> %s \n", s, u, uniq(s, u))