Skip to content

Commit

Permalink
fix: skip empty options
Browse files Browse the repository at this point in the history
  • Loading branch information
Jesse0Michael committed Nov 29, 2023
1 parent 9d5585c commit 5afb731
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions pkg/assured/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,18 @@ func WithHTTPClient(c http.Client) Option {
// WithHost sets the host option.
func WithHost(h string) Option {
return func(o *Options) {
o.host = h
if h != "" {
o.host = h
}
}
}

// WithPort sets the port option.
func WithPort(p int) Option {
return func(o *Options) {
o.Port = p
if p != 0 {
o.Port = p
}
}
}

Expand Down

0 comments on commit 5afb731

Please sign in to comment.