The User-Agent is currently hardcoded in the getFlow function and not consistently used across all requests. In other parts of the application, requests are using the default Go User-Agent. This inconsistency limits flexibility, makes it difficult to update the User-Agent across the entire application, and may lead to inconsistent behavior or potential blocking of requests by Twitter's servers.
Acceptance Criteria:
Create a config file (e.g., config.go) to store global variables.
Add a UserAgent variable in the config file.
Remove hardcoded User-Agent from getFlow function.
Modify newRequest function to use the global User-Agent.
Ensure all HTTP requests use the globally defined User-Agent, replacing the default Go User-Agent.
Add a function to allow runtime updates of the User-Agent.
Update tests to verify the new User-Agent implementation.
Document the new User-Agent configuration in the README.
Problem:
The User-Agent is currently hardcoded in the
getFlow
function and not consistently used across all requests. In other parts of the application, requests are using the default Go User-Agent. This inconsistency limits flexibility, makes it difficult to update the User-Agent across the entire application, and may lead to inconsistent behavior or potential blocking of requests by Twitter's servers.Acceptance Criteria:
config.go
) to store global variables.UserAgent
variable in the config file.getFlow
function.newRequest
function to use the global User-Agent.