Skip to content

Commit 5841cdb

Browse files
authored
SQL Imports / deps / format (#17)
* Fixes to DB * Add WithTeamDirectory() option to client/servers * Fix version printing and add method to team.Client interface. * Move transports to example directory * Print daemon listening status * Fix log level not printed in status * Add some stuff to README * Add more to README * README * Add code examples to readme * README * README Examples * README * Differences with Hashicorp plugins * Add README to example * README * README * Update ncruces/sqlite dependencies * Use go1.21 in actions * Fix cgo build * Try to fix actions CodeQL * Tidy comments * Tidy comments * Cleanup and comments tidying * Fix actions * Remove logging of cleartext credentials * Fix imports * Fix client imports * Fix and restructure imports * Fix windows action * Finish server examples code * Fix imports and update survey version * Fix imports AGAIN * Fix wrong server configs directory usage * Fixes to security alerts * Update dependencies * Remove useless imports in cgo build * Format
1 parent 6f5f17c commit 5841cdb

File tree

14 files changed

+26
-34
lines changed

14 files changed

+26
-34
lines changed

.golangci.yml

+3-4
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ linters:
184184
- godox # tool for detection of FIXME, TODO and other comments (style,cmt)
185185
- goerr113 # checks the errors handling expressions (style,err)
186186
# - gofmt # formats and checks for code simplification (fmt)
187-
# - gofumpt # checks whether code was gofumpt-ed (fmt)
187+
- gofumpt # checks whether code was gofumpt-ed (fmt)
188188
- goheader # checks if file header matches to pattern (style)
189189
- goimports # fixes imports, formats code same as gofmt (fmt,import)
190190
# - golint # Deprecated
@@ -261,7 +261,6 @@ linters:
261261
- forbidigo # Forbids identifiers (style)
262262
- gochecknoglobals # checks that no global variables exist (style)
263263
- gochecknoinits # checks that no init functions are present (style)
264-
# - goimports # fixes imports, formats code same as gofmt (fmt,import)
265264
- lll # Report long lines (style)
266265
- promlinter # checks Prometheus metrics naming via promlint
267266
- rowserrcheck # checks if Err of rows is checked successfully (bugs,sql)
@@ -281,8 +280,8 @@ linters:
281280
- wrapcheck # checks errors returned from external packages are wrapped (style,err)
282281
- tagliatelle # checks struct tags (style)
283282
- gofmt # formats and checks for code simplification (fmt)
284-
- gofumpt # checks whether code was gofumpt-ed (fmt)
285-
- gci # Controls package import order and makes deterministic (fmt,import)
283+
# - gofumpt # checks whether code was gofumpt-ed (fmt)
284+
# - goimports # fixes imports, formats code same as gofmt (fmt,import)
286285

287286
# Run only fast linters from enabled linters set (first run won't be fast)
288287
# Default: false

client/client.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,10 @@ import (
2424
"runtime"
2525
"sync"
2626

27-
"github.com/sirupsen/logrus"
28-
2927
"github.com/reeflective/team"
3028
"github.com/reeflective/team/internal/assets"
3129
"github.com/reeflective/team/internal/version"
30+
"github.com/sirupsen/logrus"
3231
)
3332

3433
// Client is the core driver of an application teamclient.

client/log.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,8 @@ import (
2323
"io"
2424
"path/filepath"
2525

26-
"github.com/sirupsen/logrus"
27-
2826
"github.com/reeflective/team/internal/log"
27+
"github.com/sirupsen/logrus"
2928
)
3029

3130
// NamedLogger returns a new logging "thread" with two fields (optional)

client/options.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,8 @@ import (
2424
"os"
2525
"strings"
2626

27-
"github.com/sirupsen/logrus"
28-
2927
"github.com/reeflective/team/internal/assets"
28+
"github.com/sirupsen/logrus"
3029
)
3130

3231
const noTeamdir = "no team subdirectory"

go.mod

+3-2
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ require (
1010
github.com/ncruces/go-sqlite3 v0.8.4
1111
github.com/ncruces/go-sqlite3/gormlite v0.8.4
1212
github.com/psanford/memfs v0.0.0-20230130182539-4dbf7e3e865e
13-
github.com/rsteube/carapace v0.37.3
13+
github.com/rsteube/carapace v0.47.4
1414
github.com/sirupsen/logrus v1.9.3
15-
github.com/spf13/cobra v1.7.0
15+
github.com/spf13/cobra v1.8.0
1616
github.com/spf13/pflag v1.0.5
1717
google.golang.org/grpc v1.56.1
1818
google.golang.org/protobuf v1.31.0
@@ -44,6 +44,7 @@ require (
4444
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect
4545
github.com/rivo/uniseg v0.2.0 // indirect
4646
github.com/rogpeppe/go-internal v1.11.0 // indirect
47+
github.com/rsteube/carapace-shlex v0.1.1 // indirect
4748
github.com/stretchr/testify v1.8.2 // indirect
4849
github.com/tetratelabs/wazero v1.4.0 // indirect
4950
golang.org/x/crypto v0.8.0 // indirect

go.sum

+7
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA
1414
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
1515
github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc=
1616
github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
17+
github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
1718
github.com/creack/pty v1.1.17 h1:QeVUsEDNrLBW4tMgZHvxy18sKtr6VI492kBhUfhDJNI=
1819
github.com/creack/pty v1.1.17/go.mod h1:MOBLtS5ELjhRRrroQr9kyvTxUAFNvYEK993ew/Vr4O4=
1920
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
@@ -116,12 +117,18 @@ github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDN
116117
github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA=
117118
github.com/rsteube/carapace v0.37.3 h1:Us0AnzZ0JiWVHmETSX8PBgp2UJCf/O7KhgSKSpokkII=
118119
github.com/rsteube/carapace v0.37.3/go.mod h1:jkLt41Ne2TD2xPuMdX/2O05Smhy8vMgG7O2TYvC0yOc=
120+
github.com/rsteube/carapace v0.47.4 h1:LwnkFsvRxc2WhZjM63QS7sCi3DlM9XGuATQM5rehgps=
121+
github.com/rsteube/carapace v0.47.4/go.mod h1:4ZC5bulItu9t9sZ5yPcHgPREd8rPf274Q732n+wfl/o=
122+
github.com/rsteube/carapace-shlex v0.1.1 h1:fRQEBBKyYKm4TXUabm4tzH904iFWSmXJl3UZhMfQNYU=
123+
github.com/rsteube/carapace-shlex v0.1.1/go.mod h1:zPw1dOFwvLPKStUy9g2BYKanI6bsQMATzDMYQQybo3o=
119124
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
120125
github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE=
121126
github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ=
122127
github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
123128
github.com/spf13/cobra v1.7.0 h1:hyqWnYt1ZQShIddO5kBpj3vu05/++x6tJ6dg8EC572I=
124129
github.com/spf13/cobra v1.7.0/go.mod h1:uLxZILRyS/50WlhOIKD7W6V5bgeIt+4sICxh6uRMrb0=
130+
github.com/spf13/cobra v1.8.0 h1:7aJaZx1B85qltLMc546zn58BxxfZdR/W22ej9CFoEf0=
131+
github.com/spf13/cobra v1.8.0/go.mod h1:WXLWApfZ71AjXPya3WOlMsY9yMs7YeiHhFVlvLyhcho=
125132
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
126133
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
127134
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=

internal/certs/certs.go

+2-3
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,10 @@ import (
3636
"path/filepath"
3737
"time"
3838

39-
"github.com/sirupsen/logrus"
40-
"gorm.io/gorm"
41-
4239
"github.com/reeflective/team/internal/assets"
4340
"github.com/reeflective/team/internal/db"
41+
"github.com/sirupsen/logrus"
42+
"gorm.io/gorm"
4443
)
4544

4645
const (

internal/db/sql-cgo.go

-5
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,6 @@ package db
2121
*/
2222

2323
import (
24-
// Embedded SQLite instance.
25-
_ "github.com/ncruces/go-sqlite3/embed"
26-
// C-code.
27-
_ "github.com/ncruces/go-sqlite3"
28-
2924
"gorm.io/driver/sqlite"
3025
"gorm.io/gorm"
3126
"gorm.io/gorm/logger"

internal/log/log.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,8 @@ import (
2323
"io"
2424
"path/filepath"
2525

26-
"github.com/sirupsen/logrus"
27-
2826
"github.com/reeflective/team/internal/assets"
27+
"github.com/sirupsen/logrus"
2928
)
3029

3130
const (

server/config.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,9 @@ import (
2727
"path/filepath"
2828
"time"
2929

30-
"github.com/sirupsen/logrus"
31-
3230
"github.com/reeflective/team/internal/assets"
3331
"github.com/reeflective/team/internal/command"
32+
"github.com/sirupsen/logrus"
3433
)
3534

3635
const (

server/core.go

+2-3
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,14 @@ import (
2424
"runtime"
2525
"sync"
2626

27-
"github.com/sirupsen/logrus"
28-
"gorm.io/gorm"
29-
3027
"github.com/reeflective/team"
3128
"github.com/reeflective/team/client"
3229
"github.com/reeflective/team/internal/assets"
3330
"github.com/reeflective/team/internal/certs"
3431
"github.com/reeflective/team/internal/db"
3532
"github.com/reeflective/team/internal/version"
33+
"github.com/sirupsen/logrus"
34+
"gorm.io/gorm"
3635
)
3736

3837
// Server is the core driver of an application teamserver.

server/db.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,10 @@ import (
2525
"path"
2626
"path/filepath"
2727

28-
"gorm.io/gorm"
29-
3028
"github.com/reeflective/team/internal/assets"
3129
"github.com/reeflective/team/internal/command"
3230
"github.com/reeflective/team/internal/db"
31+
"gorm.io/gorm"
3332
)
3433

3534
const (

server/log.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,8 @@ import (
2222
"fmt"
2323
"path/filepath"
2424

25-
"github.com/sirupsen/logrus"
26-
2725
"github.com/reeflective/team/internal/log"
26+
"github.com/sirupsen/logrus"
2827
)
2928

3029
// NamedLogger returns a new logging "thread" with two fields (optional)

server/options.go

+2-3
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,10 @@ import (
2323
"os"
2424
"strings"
2525

26-
"github.com/sirupsen/logrus"
27-
"gorm.io/gorm"
28-
2926
"github.com/reeflective/team/internal/assets"
3027
"github.com/reeflective/team/internal/db"
28+
"github.com/sirupsen/logrus"
29+
"gorm.io/gorm"
3130
)
3231

3332
const noTeamdir = "no team subdirectory"

0 commit comments

Comments
 (0)