From e39ee71430b383a7cbaf5f14af1ab0fd6950d1d0 Mon Sep 17 00:00:00 2001 From: samjtro Date: Mon, 18 Nov 2024 18:49:45 -0600 Subject: [PATCH] major ref: #70, v0.9.2 desc: - fixing bug on linux by using runtime.GOOS rather than Agent.Linux --- utils.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/utils.go b/utils.go index 4797a28..87ba314 100644 --- a/utils.go +++ b/utils.go @@ -28,7 +28,6 @@ import ( type Agent struct { Client *o.AuthorizedClient Tokens Token - Linux bool } type Token struct { @@ -235,7 +234,6 @@ func Initiate() *Agent { } else { agent.Tokens = readLinuxDB() } - agent.Linux = true } else { if _, err := os.Stat(".json"); errors.Is(err, os.ErrNotExist) { agent = initiateMacWindows() @@ -252,7 +250,7 @@ func Reinitiate() *Agent { err := os.Remove(".json") isErrNil(err) } - if agent.Linux { + if runtime.GOOS == "linux" { agent = initiateLinux() } else { agent = initiateMacWindows() @@ -289,7 +287,7 @@ func (agent *Agent) Handler(req *http.Request) (*http.Response, error) { resp *http.Response err error ) - if agent.Linux { + if runtime.GOOS == "linux" { if !time.Now().Before(agent.Tokens.BearerExpiration) { agent.Refresh() }