feat!:rename tostring to string
So we can use the default string conversion of Golang. Also refactor .Group() interface, it now receive a GoogleSearch struct pointer then converts it to string.pull/8/head
parent
86ea36ac28
commit
54cab7f720
10
google.go
10
google.go
|
@ -23,8 +23,8 @@ type GoogleSearch struct {
|
||||||
EngineFactory
|
EngineFactory
|
||||||
}
|
}
|
||||||
|
|
||||||
// ToString converts all tags to a single request
|
// String converts all tags to a single request
|
||||||
func (e *GoogleSearch) ToString() string {
|
func (e *GoogleSearch) String() string {
|
||||||
return strings.Join(e.tags, " ")
|
return strings.Join(e.tags, " ")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -96,9 +96,9 @@ func (e *GoogleSearch) Exclude(value string) *GoogleSearch {
|
||||||
return e
|
return e
|
||||||
}
|
}
|
||||||
|
|
||||||
// Group isolate tags between parentheses.
|
// Group isolate tags between parentheses
|
||||||
func (e *GoogleSearch) Group(value string) *GoogleSearch {
|
func (e *GoogleSearch) Group(tags *GoogleSearch) *GoogleSearch {
|
||||||
e.tags = append(e.tags, "("+value+")")
|
e.tags = append(e.tags, "("+tags.String()+")")
|
||||||
return e
|
return e
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue