Skip to content

Commit

Permalink
hotfix(dynv6): fix lint error for nested if
Browse files Browse the repository at this point in the history
  • Loading branch information
qdm12 committed Nov 17, 2023
1 parent 6669b39 commit daa5edb
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions internal/provider/providers/dynv6/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,18 +107,14 @@ func (p *Provider) Update(ctx context.Context, client *http.Client, ip netip.Add
values := url.Values{}
values.Set("token", p.token)
values.Set("zone", utils.BuildURLQueryHostname(p.host, p.domain))
if !p.useProviderIP {
if isIPv4 {
values.Set("ipv4", ip.String())
} else {
values.Set("ipv6", ip.String())
}
ipValue := ip.String()
if p.useProviderIP {
ipValue = "auto"
}
if isIPv4 {
values.Set("ipv4", ipValue)
} else {
if isIPv4 {
values.Set("ipv4", "auto")
} else {
values.Set("ipv6", "auto")
}
values.Set("ipv6", ipValue)
}
u.RawQuery = values.Encode()

Expand Down

0 comments on commit daa5edb

Please sign in to comment.