Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

client.go Simplify default UA logic #1466

Merged
merged 1 commit into from Jan 2, 2023

Conversation

stokito
Copy link
Contributor

@stokito stokito commented Jan 1, 2023

The getClientName() checks if !NoDefaultUserAgentHeader then returns the Client.Name field. But it also saves it to atomic field clientName. This is not needed and logic can be simplified. Previously the clientName vas a byte slice that was copied from c.Name and cached. See 02e0722

Fix #1458

The getClientName() checks if !NoDefaultUserAgentHeader then returns the Client.Name field.
But it also saves it to atomic field clientName. This is not needed and logic can be simplified.
Previously the clientName vas a byte slice that was copied from c.Name and cached. See 02e0722

Fix valyala#1458
@erikdubbelboer erikdubbelboer merged commit 51048b0 into valyala:master Jan 2, 2023
@erikdubbelboer
Copy link
Collaborator

Thanks!

@stokito stokito deleted the client_name branch January 2, 2023 09:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

client.go: getClientName() may be removed
2 participants