Skip to content
This repository has been archived by the owner on Feb 17, 2023. It is now read-only.

Detect updated UA for Googlebot #41

Merged
merged 4 commits into from
Nov 30, 2017

Conversation

delphinus
Copy link
Contributor

@delphinus delphinus commented Nov 26, 2017

Google announced they changed UA for Googlebot.

The most significant change is that the new one has Android instead of iPhone. This patch adds the detection by calling the p.googleBot() method accordingly.


In addition to that, this PR includes diff to use subtest feature. With this, go test -v shows test titles neatly and makes easy to find failed ones.


updated

hmm... Test has failed due to subtest feature. But the old Go's (<1.7) may be removed, I think.

Copy link
Owner

@mssola mssola left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, just change that small thing 👍

@@ -89,6 +89,9 @@ func webkit(p *UserAgent, comment []string) {
if len(comment) > 3 {
p.localization = comment[3]
}
if len(comment) == 3 {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prefer to use an else if instead 😉

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, I fixed 👍

@mssola mssola merged commit 6fe362d into mssola:master Nov 30, 2017
@mssola
Copy link
Owner

mssola commented Nov 30, 2017

Thanks 👍

@delphinus delphinus deleted the feature/detect-new-googlebot branch November 30, 2017 14:12
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants