From 65b745f7c5f753edf48bac02ef7af8bbfd6d846f Mon Sep 17 00:00:00 2001 From: Braydon Kains <93549768+braydonk@users.noreply.github.com> Date: Wed, 8 Nov 2023 16:50:10 -0600 Subject: [PATCH] hostmetricsreceiver: remove unused function (#29075) **Description:** `gopsutil` recently added the capability to pass environment vars through context. This is now done everywhere. This environment variable setting function is no longer used or necessary. This PR removes it. **Link to tracking Issue:** #23055 Signed-off-by: Braydon Kains --- receiver/hostmetricsreceiver/factory.go | 5 ----- 1 file changed, 5 deletions(-) diff --git a/receiver/hostmetricsreceiver/factory.go b/receiver/hostmetricsreceiver/factory.go index 5a22d2385144..e0df87763485 100644 --- a/receiver/hostmetricsreceiver/factory.go +++ b/receiver/hostmetricsreceiver/factory.go @@ -123,17 +123,12 @@ func createHostMetricsScraper(ctx context.Context, set receiver.CreateSettings, type environment interface { Lookup(k string) (string, bool) - Set(k, v string) error } type osEnv struct{} var _ environment = (*osEnv)(nil) -func (e *osEnv) Set(k, v string) error { - return os.Setenv(k, v) -} - func (e *osEnv) Lookup(k string) (string, bool) { return os.LookupEnv(k) }