Skip to content

Commit

Permalink
add lint: containedctx (#1240)
Browse files Browse the repository at this point in the history
Required updating connector interfaces. Bit annoying `ctx` everywhere,
but that's ultimately the correct way. Was running into context
complications in #1211 with connector being shared between activities

Putting context in struct essentially makes that struct a context, but
this is not the context we necessarily want. For more context, see
https://zenhorace.dev/blog/context-control-go

Some changes were made:
1. GetCatalog takes a context now instead of using
`context.Background()`
2. eventhubs processBatch now takes context instead of using
`context.Background()`
3. many instances of `Query`/`Exec` in snowflake/clickhouse converted to
`QueryContext`/`ExecContext`
4. got rid of cancel context in ssh tunnel, context being passed in is
sufficient

Followup to #1238
  • Loading branch information
serprex authored Feb 10, 2024
1 parent 38b329b commit 1213f44
Show file tree
Hide file tree
Showing 53 changed files with 818 additions and 757 deletions.
1 change: 1 addition & 0 deletions flow/.golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ run:
- generated
linters:
enable:
- containedctx
- dogsled
- durationcheck
- errcheck
Expand Down
Loading

0 comments on commit 1213f44

Please sign in to comment.