godict
godict is a simple library that generates string patterns based on dictionary.
Requirement
Go 1.15
Installing
go get github.com/hlts2/godict
Example
package main
import (
"context"
"log"
"github.com/hlts2/godict"
)
func main() {
dict, err := godict.New()
if err != nil {
log.Fatal(err)
}
log.Println("start to search pattern: 3dmax")
err = dict.Do(context.Background(), func(pattern string) {
if pattern == "3dmax" {
log.Printf("find: %s\n", pattern)
}
})
if err != nil {
log.Fatal(err)
}
}
Contribution
- Fork it ( https://github.com/hlts2/godict/fork )
- Create your feature branch (git checkout -b my-new-feature)
- Commit your changes (git commit -am 'Add some feature')
- Push to the branch (git push origin my-new-feature)
- Create new Pull Request
Author
hlts2