Skip to content

Commit

Permalink
major
Browse files Browse the repository at this point in the history
ref: #70, v0.9.2
desc:
- fixing bug on linux by using runtime.GOOS rather than Agent.Linux
  • Loading branch information
samjtro committed Nov 19, 2024
1 parent 8bd9d4e commit e39ee71
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ import (
type Agent struct {
Client *o.AuthorizedClient
Tokens Token
Linux bool
}

type Token struct {
Expand Down Expand Up @@ -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()
Expand All @@ -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()
Expand Down Expand Up @@ -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()
}
Expand Down

0 comments on commit e39ee71

Please sign in to comment.