File tree 4 files changed +37
-1
lines changed
4 files changed +37
-1
lines changed Original file line number Diff line number Diff line change @@ -2,4 +2,7 @@ module github.com/googege/gotools
2
2
3
3
go 1.14
4
4
5
- require github.com/google/uuid v1.1.1
5
+ require (
6
+ github.com/googege/godata v0.7.0
7
+ github.com/google/uuid v1.1.1
8
+ )
Original file line number Diff line number Diff line change
1
+ github.com/googege/godata v0.7.0 h1:kHoJ4a2sVIRisdTKxneCTrP8JpwcTTjjhFU/juMxH24 =
2
+ github.com/googege/godata v0.7.0 /go.mod h1:A/5/f6RN0WjJFrMGDnNcFolIQ2eiRgIlXSWWAU5UddQ =
1
3
github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY =
2
4
github.com/google/uuid v1.1.1 /go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo =
5
+ github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0bLI =
6
+ github.com/spaolacci/murmur3 v1.1.0 /go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA =
Original file line number Diff line number Diff line change 1
1
package str
2
+
3
+ type Str interface {
4
+ IsExit (v interface {})bool
5
+ Insert (v interface {})
6
+ }
7
+
8
+
9
+ func StrIs (s Str ,value interface {})bool {
10
+ return s .IsExit (value )
11
+ }
Original file line number Diff line number Diff line change 1
1
package str
2
+
3
+ import "github.com/googege/godata"
4
+
5
+ type Trie struct {
6
+ Value * godata.Trie
7
+ }
8
+
9
+ func (t * Trie ) IsExit (v interface {}) bool {
10
+ vt := v .(string )
11
+ b , _ := t .Value .StartsWith (vt )
12
+ return b
13
+ }
14
+ func (t * Trie ) Insert (v interface {}) {
15
+ t .Value .Insert (v .(string ))
16
+ }
17
+ // return a new Trie.
18
+ func NewTrie () Str {
19
+ return & Trie {Value : godata .NewTrie ()}
20
+ }
You can’t perform that action at this time.
0 commit comments