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
sundowndev 2020-06-15 10:48:53 +02:00
parent 86ea36ac28
commit 54cab7f720
1 changed files with 5 additions and 5 deletions

View File

@ -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
}