Skip to content

Commit

Permalink
chore: code grooming
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasmalkmus committed Jul 17, 2023
1 parent a60368d commit 0654c24
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 12 deletions.
1 change: 1 addition & 0 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/server_regression.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ jobs:
# environment, across all active jobs and workflows.
concurrency:
group: ${{ matrix.environment }}
cancel-in-progress: false
strategy:
matrix:
go:
Expand Down
2 changes: 1 addition & 1 deletion axiom/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions axiom/orgs.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
6 changes: 3 additions & 3 deletions axiom/query/result.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,16 +193,16 @@ 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

if err := json.Unmarshal(b, localStatus(s)); err != nil {
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

Expand Down
7 changes: 3 additions & 4 deletions axiom/querylegacy/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
}

Expand Down Expand Up @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions axiom/querylegacy/result.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down

0 comments on commit 0654c24

Please sign in to comment.