From 3edfe3725ee804c5c03d2811b4c53e9f472c6d92 Mon Sep 17 00:00:00 2001 From: Sebastian Schubert Date: Sun, 15 Mar 2026 16:11:48 +0100 Subject: [PATCH] renamed version to fortiversion to avoid nameing conflict Signed-off-by: Sebastian Schubert --- internal/{version => fortiversion}/main.go | 2 +- internal/{version => fortiversion}/main_test.go | 2 +- pkg/probe/firewall_policy.go | 4 ++-- pkg/probe/probe.go | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) rename internal/{version => fortiversion}/main.go (98%) rename internal/{version => fortiversion}/main_test.go (98%) diff --git a/internal/version/main.go b/internal/fortiversion/main.go similarity index 98% rename from internal/version/main.go rename to internal/fortiversion/main.go index 198096f2..94027e58 100644 --- a/internal/version/main.go +++ b/internal/fortiversion/main.go @@ -28,7 +28,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . -package version +package fortiversion import ( "fmt" diff --git a/internal/version/main_test.go b/internal/fortiversion/main_test.go similarity index 98% rename from internal/version/main_test.go rename to internal/fortiversion/main_test.go index ebd9e03f..6110e4f4 100644 --- a/internal/version/main_test.go +++ b/internal/fortiversion/main_test.go @@ -28,7 +28,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . -package version +package fortiversion import ( "testing" diff --git a/pkg/probe/firewall_policy.go b/pkg/probe/firewall_policy.go index 68e63bfd..b9c588d4 100644 --- a/pkg/probe/firewall_policy.go +++ b/pkg/probe/firewall_policy.go @@ -19,7 +19,7 @@ import ( "github.com/prometheus/client_golang/prometheus" - "github.com/prometheus-community/fortigate_exporter/internal/version" + "github.com/prometheus-community/fortigate_exporter/internal/fortiversion" "github.com/prometheus-community/fortigate_exporter/pkg/fortigatehttpclient" ) @@ -81,7 +81,7 @@ func probeFirewallPolicies(c fortigatehttpclient.FortiHTTP, _ *TargetMetadata) ( } combined := false - major, minor, ok := version.ParseVersion(ps4[0].Version) + major, minor, ok := fortiversion.ParseVersion(ps4[0].Version) if !ok { log.Printf("Could not parse version number %q", ps4[0].Version) return nil, false diff --git a/pkg/probe/probe.go b/pkg/probe/probe.go index 2189adfa..4845ad4d 100644 --- a/pkg/probe/probe.go +++ b/pkg/probe/probe.go @@ -41,7 +41,7 @@ import ( "github.com/prometheus/client_golang/prometheus" "github.com/prometheus-community/fortigate_exporter/internal/config" - "github.com/prometheus-community/fortigate_exporter/internal/version" + "github.com/prometheus-community/fortigate_exporter/internal/fortiversion" fortiHTTP "github.com/prometheus-community/fortigate_exporter/pkg/fortigatehttpclient" ) @@ -110,7 +110,7 @@ func (p *Collector) Probe(ctx context.Context, target map[string]string, hc *htt return false, nil } - major, minor, ok := version.ParseVersion(st.Version) + major, minor, ok := fortiversion.ParseVersion(st.Version) if !ok { log.Printf("Error: Failed to parse OS version: %q", st.Version) return false, nil