Skip to content

Commit

Permalink
Update linter config (#1675)
Browse files Browse the repository at this point in the history
Co-authored-by: Raúl Barroso <[email protected]>
  • Loading branch information
hariso and raulb authored Jun 28, 2024
1 parent c622e32 commit f53d710
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 11 deletions.
11 changes: 6 additions & 5 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
run:
timeout: 3m
exclude-dirs-use-default: false
exclude-dirs:
- ^examples/
- ^ui/
- ^pkg/plugin/processor/builtin/internal/diff # external code

linters-settings:
depguard:
Expand Down Expand Up @@ -42,6 +37,12 @@ linters-settings:
disabled: true

issues:
exclude-dirs-use-default: false
exclude-dirs:
- ^examples/
- ^ui/
- ^pkg/plugin/processor/builtin/internal/diff # external code

exclude-rules:
- path: 'pkg/plugin/processor/builtin/impl'
linters:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,7 @@ func (e extractor) extract(path []string, v reflect.Value, t reflect.Type) (avro
case reflect.Map:
return e.extractMap(path, v, t)
case reflect.Struct:
switch t {
case timeType:
if t == timeType {
return avro.NewPrimitiveSchema(
avro.Long,
avro.NewPrimitiveLogicalSchema(avro.TimestampMicros),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,17 +46,18 @@ func NewUnionResolver(schema avro.Schema) UnionResolver {
// traverse the schema and extract paths to all maps and arrays with a union
// as the value type
traverseSchema(schema, func(p path) {
if isMapUnion(p[len(p)-1].schema) {
switch {
case isMapUnion(p[len(p)-1].schema):
// path points to a map with a union type, copy and store it
pCopy := make(path, len(p))
copy(pCopy, p)
mapUnionPaths = append(mapUnionPaths, pCopy)
} else if isArrayUnion(p[len(p)-1].schema) {
case isArrayUnion(p[len(p)-1].schema):
// path points to an array with a union type, copy and store it
pCopy := make(path, len(p))
copy(pCopy, p)
arrayUnionPaths = append(arrayUnionPaths, pCopy)
} else if isNullUnion(p[len(p)-1].schema) {
case isNullUnion(p[len(p)-1].schema):
// path points to a null union, copy and store it
pCopy := make(path, len(p)-1)
copy(pCopy, p[:len(p)-1])
Expand Down
2 changes: 1 addition & 1 deletion pkg/plugin/processor/builtin/impl/webhook/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ func (c *httpConfig) parseHeaders() error {
}

var isContentTypeSet bool
for name, _ := range c.Headers {
for name := range c.Headers {
if strings.ToLower(name) == "content-type" {
isContentTypeSet = true
break
Expand Down

0 comments on commit f53d710

Please sign in to comment.