MCPcopy Create free account
hub / github.com/Code-Hex/pget / WithUserAgent

Function WithUserAgent

download.go:126–133  ·  view source on GitHub ↗
(ua, version string)

Source from the content-addressed store, hash-verified

124type DownloadOption func(c *DownloadConfig)
125
126func WithUserAgent(ua, version string) DownloadOption {
127 return func(c *DownloadConfig) {
128 if ua == "" {
129 ua = "Pget/" + version
130 }
131 c.makeRequestOption.useragent = ua
132 }
133}
134
135func WithReferer(referer string) DownloadOption {
136 return func(c *DownloadConfig) {

Callers 1

RunMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected