Skip to content

Commit 4fceda6

Browse files
authored
chore: Fix linting (#5)
1 parent 6638a8b commit 4fceda6

File tree

4 files changed

+24
-29
lines changed

4 files changed

+24
-29
lines changed

.github/workflows/lint_golang.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ jobs:
1616
- uses: actions/checkout@v3
1717
- uses: actions/setup-go@v3
1818
with:
19-
go-version: '1.18'
19+
go-version: 1.18
2020
- name: golangci-lint
2121
uses: golangci/golangci-lint-action@v3
2222
with:
23-
version: v1.46.2
24-
args: --timeout 10m --verbose
23+
version: v1.47.3
24+
args: --verbose

.golangci.yml

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
1-
# DONT EDIT. This file is synced from https://github.com/cloudquery/.github/.github
21
run:
32
tests: true
4-
timeout: 5m
3+
timeout: 10m
54
skip-dirs:
6-
- bin
7-
- docs
8-
- cqproto/internal
5+
- internal/pb
96

107
linters-settings:
118
errcheck:
@@ -57,7 +54,7 @@ linters-settings:
5754
- name: exported
5855
disabled: false
5956
arguments:
60-
- 'disableStutteringCheck'
57+
- "disableStutteringCheck"
6158
- name: unused-parameter
6259
disabled: true
6360
- name: confusing-naming
@@ -93,4 +90,3 @@ linters:
9390
- unparam
9491
- unused
9592
- varcheck
96-

helpers/limit/limits.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ import (
77
"github.com/pbnjay/memory"
88
)
99

10+
type Rlimit struct {
11+
Cur uint64
12+
Max uint64
13+
}
14+
1015
const (
1116
gbInBytes int = 1024 * 1024 * 1024
1217
goroutinesPerGB float64 = 250000
@@ -16,11 +21,6 @@ const (
1621
mfoReducer = 0.75
1722
)
1823

19-
type Rlimit struct {
20-
Cur uint64
21-
Max uint64
22-
}
23-
2424
func GetMaxGoRoutines() uint64 {
2525
limit := calculateGoRoutines(getMemory())
2626
ulimit, err := GetUlimit()

plugins/source.go

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package plugins
22

33
import (
44
"context"
5+
_ "embed"
56
"fmt"
67
"sync"
78
"time"
@@ -14,22 +15,8 @@ import (
1415
"github.com/thoas/go-funk"
1516
"github.com/xeipuuv/gojsonschema"
1617
"golang.org/x/sync/semaphore"
17-
18-
_ "embed"
1918
)
2019

21-
//go:embed source_schema.json
22-
var sourceSchema string
23-
24-
const ExampleSourceConfig = `
25-
# max_goroutines to use when fetching. 0 means default and calculated by CloudQuery
26-
# max_goroutines: 0
27-
# By default cloudquery will fetch all tables in the source plugin
28-
# tables: ["*"]
29-
# skip_tables specify which tables to skip. especially useful when using "*" for tables
30-
# skip_tables: []
31-
`
32-
3320
// SourcePlugin is the base structure required to pass to sdk.serve
3421
// We take a similar/declerative approach to API here similar to Cobra
3522
type SourcePlugin struct {
@@ -53,6 +40,18 @@ type SourcePlugin struct {
5340
spec *specs.SourceSpec
5441
}
5542

43+
const ExampleSourceConfig = `
44+
# max_goroutines to use when fetching. 0 means default and calculated by CloudQuery
45+
# max_goroutines: 0
46+
# By default cloudquery will fetch all tables in the source plugin
47+
# tables: ["*"]
48+
# skip_tables specify which tables to skip. especially useful when using "*" for tables
49+
# skip_tables: []
50+
`
51+
52+
//go:embed source_schema.json
53+
var sourceSchema string
54+
5655
func (p *SourcePlugin) Init(ctx context.Context, spec specs.SourceSpec) (*gojsonschema.Result, error) {
5756
res, err := specs.ValidateSpec(sourceSchema, spec)
5857
if err != nil {

0 commit comments

Comments
 (0)