-
-
Notifications
You must be signed in to change notification settings - Fork 78
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
feat: add default user-agent string #57
Conversation
Codecov Report
@@ Coverage Diff @@
## master #57 +/- ##
==========================================
+ Coverage 69.56% 70.27% +0.71%
==========================================
Files 7 7
Lines 506 508 +2
==========================================
+ Hits 352 357 +5
+ Misses 114 112 -2
+ Partials 40 39 -1
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
@@ -131,8 +129,11 @@ type DownloadConfig struct { | |||
|
|||
type DownloadOption func(c *DownloadConfig) | |||
|
|||
func WithUserAgent(ua string) DownloadOption { | |||
func WithUserAgent(ua, version string) DownloadOption { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This version
parameter is unnecessary. Because version is global variable. Could you remove this one?
func WithUserAgent(ua, version string) DownloadOption { | |
func WithUserAgent(ua string) DownloadOption { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line 7 in e73109e
ldflags: -s -w -X main.version={{.Version}} |
Line 11 in 7c82871
var version string |
Line 15 in 7c82871
if err := cli.Run(context.Background(), version, os.Args[1:]); err != nil { |
Lines 41 to 44 in 7c82871
func (pget *Pget) Run(ctx context.Context, version string, args []string) error { | |
if err := pget.Ready(version, args); err != nil { | |
return errTop(err) | |
} |
The version
not is global variable, only main file exists
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see. I forget my code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks
user-agent string like Wget