You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To give a bit of context as to what I am talking about, here is how the NewClient function looks like:
// NewClient returns a new mastodon API client.funcNewClient(config*Config) *Client {
return&Client{
Client: *http.DefaultClient,
Config: config,
}
}
While I could possibly understand the concerns (prevent mutability, etc), it breaks the expected semantic. http.Client is a pointer type (as it can be seen by http.DefaultHTTPClient). Even though a copy by value is perfectly OK for now, you may never know if it won't hold a mutex or something similar in the future that would turn making a copy into a bug.
The text was updated successfully, but these errors were encountered:
To give a bit of context as to what I am talking about, here is how the
NewClient
function looks like:While I could possibly understand the concerns (prevent mutability, etc), it breaks the expected semantic.
http.Client
is a pointer type (as it can be seen byhttp.DefaultHTTPClient
). Even though a copy by value is perfectly OK for now, you may never know if it won't hold a mutex or something similar in the future that would turn making a copy into a bug.The text was updated successfully, but these errors were encountered: