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
|
||||
}
|
||||
|
||||
// ToString converts all tags to a single request
|
||||
func (e *GoogleSearch) ToString() string {
|
||||
// String converts all tags to a single request
|
||||
func (e *GoogleSearch) String() string {
|
||||
return strings.Join(e.tags, " ")
|
||||
}
|
||||
|
||||
|
@ -96,9 +96,9 @@ func (e *GoogleSearch) Exclude(value string) *GoogleSearch {
|
|||
return e
|
||||
}
|
||||
|
||||
// Group isolate tags between parentheses.
|
||||
func (e *GoogleSearch) Group(value string) *GoogleSearch {
|
||||
e.tags = append(e.tags, "("+value+")")
|
||||
// Group isolate tags between parentheses
|
||||
func (e *GoogleSearch) Group(tags *GoogleSearch) *GoogleSearch {
|
||||
e.tags = append(e.tags, "("+tags.String()+")")
|
||||
return e
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue