mirror of
https://github.com/gravitational/teleport.git
synced 2026-10-12 02:15:01 +00:00
Linter fixes (#13283)
* Remove and prohibit github.com/siddontang/go/log * Fix linter warnings on darwin
This commit is contained in:
@@ -34,6 +34,8 @@ linters-settings:
|
||||
include-go-root: true # check against stdlib
|
||||
packages-with-error-message:
|
||||
- io/ioutil: 'use "io" or "os" packages instead'
|
||||
- github.com/siddontang/go/log: 'use "github.com/sirupsen/logrus" instead'
|
||||
- github.com/siddontang/go-log/log: 'use "github.com/sirupsen/logrus" instead'
|
||||
|
||||
output:
|
||||
uniq-by-line: false
|
||||
|
||||
+7
-4
@@ -23,18 +23,21 @@ import (
|
||||
"os/user"
|
||||
"time"
|
||||
|
||||
"github.com/gravitational/trace"
|
||||
log "github.com/sirupsen/logrus"
|
||||
|
||||
"github.com/gravitational/teleport/api/types"
|
||||
"github.com/gravitational/teleport/lib/services"
|
||||
"github.com/gravitational/teleport/lib/services/local"
|
||||
"github.com/gravitational/teleport/lib/utils"
|
||||
"github.com/gravitational/trace"
|
||||
"github.com/siddontang/go/log"
|
||||
)
|
||||
|
||||
// NewHostUsers initialize a new HostUsers object
|
||||
func NewHostUsers(ctx context.Context, storage *local.PresenceService) (HostUsers, error) {
|
||||
backend, err := newHostUsersBackend()
|
||||
if err != nil {
|
||||
// newHostUsersBackend statically returns a valid backend or an error,
|
||||
// resulting in a staticcheck linter error on darwin
|
||||
backend, err := newHostUsersBackend() //nolint:staticcheck
|
||||
if err != nil { //nolint:staticcheck
|
||||
return nil, trace.Wrap(err)
|
||||
}
|
||||
cancelCtx, cancelFunc := context.WithCancel(ctx)
|
||||
|
||||
@@ -23,6 +23,7 @@ import (
|
||||
"github.com/gravitational/trace"
|
||||
)
|
||||
|
||||
//nolint:staticcheck // intended to always return an error for non-linux builds
|
||||
func newHostUsersBackend() (HostUsersBackend, error) {
|
||||
return nil, trace.NotImplemented("Host user creation management is only supported on linux")
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ import (
|
||||
"strings"
|
||||
|
||||
"github.com/gravitational/trace"
|
||||
"github.com/siddontang/go-log/log"
|
||||
log "github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
// man GROUPADD(8), exit codes section
|
||||
|
||||
Reference in New Issue
Block a user