Skip to content

Commit

Permalink
fix: linting issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Jan Henkel committed Nov 21, 2024
1 parent 616f804 commit d37aedb
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
3 changes: 2 additions & 1 deletion fetcher/loadbalancer_traffic.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ func (loadbalancerTraffic loadbalancerTraffic) Run(client *hcloud.Client) error
parseAdditionalLabels(loadbalancerTraffic.additionalLabels, lb.Labels)...,
)

additionalTraffic := int(lb.OutgoingTraffic) - int(lb.IncludedTraffic)
//nolint:gosec
additionalTraffic := int64(lb.OutgoingTraffic) - int64(lb.IncludedTraffic)
if additionalTraffic < 0 {
loadbalancerTraffic.hourly.WithLabelValues(labels...).Set(0)
loadbalancerTraffic.monthly.WithLabelValues(labels...).Set(0)
Expand Down
4 changes: 2 additions & 2 deletions fetcher/prices.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ func (provider *PriceProvider) FloatingIP(ipType hcloud.FloatingIPType, location
}
}

// If the pricing can not be determined by the type and location, we fall back to the old pricing
return parsePrice(provider.getPricing().FloatingIP.Monthly.Gross)
// If the pricing can not be determined by the type and location, we just return 0.00
return 0.0
}

// PrimaryIP returns the current price for a primary IP per hour and month.
Expand Down
3 changes: 2 additions & 1 deletion fetcher/server_traffic.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ func (serverTraffic serverTraffic) Run(client *hcloud.Client) error {
parseAdditionalLabels(serverTraffic.additionalLabels, s.Labels)...,
)

additionalTraffic := int(s.OutgoingTraffic) - int(s.IncludedTraffic)
//nolint:gosec
additionalTraffic := int64(s.OutgoingTraffic) - int64(s.IncludedTraffic)
if additionalTraffic < 0 {
serverTraffic.hourly.WithLabelValues(labels...).Set(0)
serverTraffic.monthly.WithLabelValues(labels...).Set(0)
Expand Down

0 comments on commit d37aedb

Please sign in to comment.