Skip to content

Commit

Permalink
fix linting
Browse files Browse the repository at this point in the history
  • Loading branch information
stefan.rieckhof committed Aug 23, 2024
1 parent 21fe0b2 commit fd03501
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 11 deletions.
2 changes: 1 addition & 1 deletion backend/redis/redis.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ func (lt *logtracer) ProcessHook(next redis.ProcessHook) redis.ProcessHook {
span: span,
})

next(ctx, cmd)
_ = next(ctx, cmd)

vals := ctx.Value(logtracerKey{}).(*logtracerValues)
le := log.Ctx(ctx).Debug().Str("cmd", cmd.Name()).Str("sentry:category", "redis")
Expand Down
12 changes: 6 additions & 6 deletions http/jsonapi/response.go
Original file line number Diff line number Diff line change
Expand Up @@ -382,15 +382,15 @@ func visitModelNode(model interface{}, included *map[string]*Node,
// We need to pass a pointer value
ptr := reflect.New(fieldValue.Type())
ptr.Elem().Set(fieldValue)
n, err := visitModelNode(ptr.Interface(), nil, false)
if err != nil {
return nil, err
n, err1 := visitModelNode(ptr.Interface(), nil, false)
if err1 != nil {
return nil, err1
}
node.Attributes[args[1]], err = json.Marshal(n.Attributes)
} else if fieldValue.Type().Kind() == reflect.Ptr && fieldValue.Elem().Kind() == reflect.Struct {
n, err := visitModelNode(fieldValue.Interface(), nil, false)
if err != nil {
return nil, err
n, err1 := visitModelNode(fieldValue.Interface(), nil, false)
if err1 != nil {
return nil, err1
}
node.Attributes[args[1]], err = json.Marshal(n.Attributes)
} else {
Expand Down
3 changes: 3 additions & 0 deletions http/jsonapi/response_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"bytes"
"encoding/json"
"fmt"
"github.com/stretchr/testify/require"
"reflect"
"sort"
"strings"
Expand Down Expand Up @@ -556,6 +557,8 @@ func TestMarshalISO8601TimePointer(t *testing.T) {

func TestMarshalUnmarshalStructWithNestedFields(t *testing.T) {
ts, err := isotime.ParseISO8601("2022-11-17T22:22:25.841137+01:00")
require.NoError(t, err)

s := &StructWithNestedFields{
Timestamp: ts,
NestedStructPointer: &NestedField{NestedTimestamp: ts},
Expand Down
2 changes: 1 addition & 1 deletion http/transport/dump_options.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ func NewDumpOptions(opts ...DumpOption) (DumpOptions, error) {
type DumpOptions map[string]bool

func (o DumpOptions) IsEnabled(option string) bool {
isEnabled, _ := o[option]
isEnabled := o[option]
return isEnabled
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ func (g *Generator) BuildDefinitions(errors runtime.Errors, packagePath, package
continue
}

constObjects = append(constObjects, jen.Id(fmt.Sprintf("ERR_CODE_%s", jsonError.Code)).Op("=").Lit(fmt.Sprintf("%s", jsonError.Code)))
constObjects = append(constObjects, jen.Id(fmt.Sprintf("ERR_CODE_%s", jsonError.Code)).Op("=").Lit(jsonError.Code))

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@ func (g *Generator) generateMarkdown(eds ErrorDefinitions) (string, error) {
if err != nil {
return "", err
}
_, err = output.WriteString(fmt.Sprint(`|Code|Title|
_, err = output.WriteString(`|Code|Title|
|-----------|-----------|
`))
`)
if err != nil {
panic(err)
}
Expand Down

0 comments on commit fd03501

Please sign in to comment.