Files
reddit-go/geddit_opts.go
T
Vartan Benohanian 3c7aee142d Get subreddit by name
Signed-off-by: Vartan Benohanian <vartanbeno@gmail.com>
2020-04-23 22:57:47 -04:00

15 lines
308 B
Go

package geddit
import "fmt"
// Opt is a configuration option to initialize a client
type Opt func(*Client) error
// WithUserAgent sets the user agent for the client
func WithUserAgent(ua string) Opt {
return func(c *Client) error {
c.UserAgent = fmt.Sprintf("%s %s", ua, c.UserAgent)
return nil
}
}