refactor: rename ToURL method to URL

pull/12/head
sundowndev 2020-09-05 16:48:10 +02:00
parent c339ef7be8
commit 8aa349a3e3
2 changed files with 3 additions and 3 deletions

View File

@ -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()

View File

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