refactor: rename ToURL method to URL
parent
c339ef7be8
commit
8aa349a3e3
|
@ -42,8 +42,8 @@ func (e *GoogleSearch) QueryValues() url.Values {
|
|||
return params
|
||||
}
|
||||
|
||||
// ToURL converts tags to an encoded Google Search URL
|
||||
func (e *GoogleSearch) ToURL() string {
|
||||
// URL converts tags to an encoded Google Search URL
|
||||
func (e *GoogleSearch) URL() string {
|
||||
baseURL, _ := url.Parse(searchURL)
|
||||
|
||||
baseURL.RawQuery = e.QueryValues().Encode()
|
||||
|
|
|
@ -18,7 +18,7 @@ func TestInit(t *testing.T) {
|
|||
|
||||
result := dork.
|
||||
Site("example.com").
|
||||
ToURL()
|
||||
URL()
|
||||
|
||||
assert.Equal(result, "https://www.google.com/search?q=site%3Aexample.com", "they should be equal")
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue