From 0654c241e3c4dc7c6e2f59b39430d52a654b4a87 Mon Sep 17 00:00:00 2001 From: Lukas Malkmus Date: Mon, 17 Jul 2023 15:10:08 +0200 Subject: [PATCH] chore: code grooming --- .github/workflows/pr.yaml | 1 + .github/workflows/push.yaml | 1 + .github/workflows/server_regression.yaml | 1 + axiom/client.go | 2 +- axiom/orgs.go | 4 ++-- axiom/query/result.go | 6 +++--- axiom/querylegacy/query.go | 7 +++---- axiom/querylegacy/result.go | 4 ++-- 8 files changed, 14 insertions(+), 12 deletions(-) diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index c091399e..3e4ef987 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -92,6 +92,7 @@ jobs: # environment (and thus not affect the overall workflow status). concurrency: group: ${{ matrix.environment }} + cancel-in-progress: false continue-on-error: ${{ matrix.environment == 'development' }} strategy: fail-fast: true diff --git a/.github/workflows/push.yaml b/.github/workflows/push.yaml index 07bd2d17..c936fcea 100644 --- a/.github/workflows/push.yaml +++ b/.github/workflows/push.yaml @@ -58,6 +58,7 @@ jobs: # environment (and thus not affect the overall workflow status). concurrency: group: ${{ matrix.environment }} + cancel-in-progress: false continue-on-error: ${{ matrix.environment == 'development' }} strategy: fail-fast: true diff --git a/.github/workflows/server_regression.yaml b/.github/workflows/server_regression.yaml index f166867d..5965df98 100644 --- a/.github/workflows/server_regression.yaml +++ b/.github/workflows/server_regression.yaml @@ -20,6 +20,7 @@ jobs: # environment, across all active jobs and workflows. concurrency: group: ${{ matrix.environment }} + cancel-in-progress: false strategy: matrix: go: diff --git a/axiom/client.go b/axiom/client.go index bf20c899..e88e8584 100644 --- a/axiom/client.go +++ b/axiom/client.go @@ -296,7 +296,7 @@ func (c *Client) Do(req *http.Request, v any) (*Response, error) { if statusCode := resp.StatusCode; statusCode >= 400 { // Handle common http status codes by returning proper errors so it is - // possible to check for them using `errors.Is()`. + // possible to check for them using [errors.Is]. switch statusCode { case http.StatusUnauthorized: return resp, ErrUnauthenticated diff --git a/axiom/orgs.go b/axiom/orgs.go index 887f4c06..92255719 100644 --- a/axiom/orgs.go +++ b/axiom/orgs.go @@ -171,7 +171,7 @@ func (l License) MarshalJSON() ([]byte, error) { } // UnmarshalJSON implements [json.Unmarshaler]. It is in place to unmarshal the -// MaxQueryWindow and MaxAuditWindow into a proper time.Duration value because +// MaxQueryWindow and MaxAuditWindow into a proper [time.Duration] value because // the server returns it in seconds. func (l *License) UnmarshalJSON(b []byte) error { type localLicense *License @@ -180,7 +180,7 @@ func (l *License) UnmarshalJSON(b []byte) error { return err } - // Set to a proper time.Duration value by interpreting the server response + // Set to a proper [time.Duration] value by interpreting the server response // value in seconds. l.MaxQueryWindow = l.MaxQueryWindow * time.Second l.MaxAuditWindow = l.MaxAuditWindow * time.Second diff --git a/axiom/query/result.go b/axiom/query/result.go index 9302b577..c117c302 100644 --- a/axiom/query/result.go +++ b/axiom/query/result.go @@ -193,8 +193,8 @@ func (s Status) MarshalJSON() ([]byte, error) { } // UnmarshalJSON implements [json.Unmarshaler]. It is in place to unmarshal the -// elapsed time into a proper time.Duration value because the server returns it -// in microseconds. +// elapsed time into a proper [time.Duration] value because the server returns +// it in microseconds. func (s *Status) UnmarshalJSON(b []byte) error { type localStatus *Status @@ -202,7 +202,7 @@ func (s *Status) UnmarshalJSON(b []byte) error { return err } - // Set to a proper time.Duration value by interpreting the server response + // Set to a proper [time.Duration] value by interpreting the server response // value in microseconds. s.ElapsedTime = s.ElapsedTime * time.Microsecond diff --git a/axiom/querylegacy/query.go b/axiom/querylegacy/query.go index 475f5e98..4f191d1d 100644 --- a/axiom/querylegacy/query.go +++ b/axiom/querylegacy/query.go @@ -42,8 +42,7 @@ type Query struct { // IncludeCursor will return the Cursor as part of the query result, if set // to true. IncludeCursor bool `json:"includeCursor"` - // ContinuationToken is used to get more results of a previous query. It is - // not valid for starred queries or otherwise stored queries. + // ContinuationToken is used to get more results of a previous query. ContinuationToken string `json:"continuationToken"` } @@ -72,8 +71,8 @@ func (q Query) MarshalJSON() ([]byte, error) { } // UnmarshalJSON implements [json.Unmarshaler]. It is in place to unmarshal the -// queries resolution string value to a proper time.Duration because that's what -// the server returns. +// queries resolution string value to a proper [time.Duration] value because +// that's what the server returns. func (q *Query) UnmarshalJSON(b []byte) error { type LocalQuery Query localQuery := struct { diff --git a/axiom/querylegacy/result.go b/axiom/querylegacy/result.go index 57d3a939..747e8c46 100644 --- a/axiom/querylegacy/result.go +++ b/axiom/querylegacy/result.go @@ -192,7 +192,7 @@ func (s Status) MarshalJSON() ([]byte, error) { } // UnmarshalJSON implements [json.Unmarshaler]. It is in place to unmarshal the -// ElapsedTime into a proper time.Duration value because the server returns it +// ElapsedTime into a proper [time.Duration] value because the server returns it // in microseconds. func (s *Status) UnmarshalJSON(b []byte) error { type localStatus *Status @@ -201,7 +201,7 @@ func (s *Status) UnmarshalJSON(b []byte) error { return err } - // Set to a proper time.Duration value by interpreting the server response + // Set to a proper [time.Duration] value by interpreting the server response // value in microseconds. s.ElapsedTime = s.ElapsedTime * time.Microsecond