Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitedeb9bb

Browse files
authored
fix: appease linter on darwin (#11154)
Fixing up some linting errors that show up on Darwin, but not in CI.
1 parent2883cad commitedeb9bb

File tree

8 files changed

+20
-11
lines changed

8 files changed

+20
-11
lines changed

‎agent/agentproc/proc_other.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,18 @@ import (
77
"github.com/spf13/afero"
88
)
99

10-
func (p*Process)Niceness(scSyscaller) (int,error) {
10+
func (*Process)Niceness(Syscaller) (int,error) {
1111
return0,errUnimplemented
1212
}
1313

14-
func (p*Process)SetNiceness(scSyscaller,scoreint)error {
14+
func (*Process)SetNiceness(Syscaller,int)error {
1515
returnerrUnimplemented
1616
}
1717

18-
func (p*Process)Cmd()string {
18+
func (*Process)Cmd()string {
1919
return""
2020
}
2121

22-
funcList(fsafero.Fs,syscallerSyscaller) ([]*Process,error) {
22+
funcList(afero.Fs,Syscaller) ([]*Process,error) {
2323
returnnil,errUnimplemented
2424
}

‎agent/agentproc/syscaller.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ type Syscaller interface {
1010
Kill(pidint32,sig syscall.Signal)error
1111
}
1212

13+
// nolint: unused // used on some but no all platforms
1314
constdefaultProcDir="/proc"
1415

1516
typeProcessstruct {

‎agent/agentproc/syscaller_other.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@ var errUnimplemented = xerrors.New("unimplemented")
1717

1818
typenopSyscallerstruct{}
1919

20-
func (nopSyscaller)SetPriority(pidint32,priorityint)error {
20+
func (nopSyscaller)SetPriority(int32,int)error {
2121
returnerrUnimplemented
2222
}
2323

24-
func (nopSyscaller)GetPriority(pidint32) (int,error) {
24+
func (nopSyscaller)GetPriority(int32) (int,error) {
2525
return0,errUnimplemented
2626
}
2727

28-
func (nopSyscaller)Kill(pidint32,sig syscall.Signal)error {
28+
func (nopSyscaller)Kill(int32, syscall.Signal)error {
2929
returnerrUnimplemented
3030
}

‎agent/agentssh/jetbrainstrack.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@ import (
44
"strings"
55
"sync"
66

7-
"cdr.dev/slog"
87
"github.com/gliderlabs/ssh"
98
"go.uber.org/atomic"
109
gossh"golang.org/x/crypto/ssh"
10+
11+
"cdr.dev/slog"
1112
)
1213

1314
// localForwardChannelData is copied from the ssh package.

‎agent/agentssh/portinspection_unsupported.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
package agentssh
44

5-
funcgetListeningPortProcessCmdline(portuint32) (string,error) {
5+
funcgetListeningPortProcessCmdline(uint32) (string,error) {
66
// We are not worrying about other platforms at the moment because Gateway
77
// only supports Linux anyway.
88
return"",nil

‎agent/api.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,11 @@ type listeningPortsHandler struct {
4444
ignorePortsmap[int]string
4545
cacheDuration time.Duration
4646

47-
mut sync.Mutex
47+
//nolint: unused // used on some but not all platforms
48+
mut sync.Mutex
49+
//nolint: unused // used on some but not all platforms
4850
ports []codersdk.WorkspaceAgentListeningPort
51+
//nolint: unused // used on some but not all platforms
4952
mtime time.Time
5053
}
5154

‎agent/ports_unsupported.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ package agent
44

55
import"github.com/coder/coder/v2/codersdk"
66

7-
func (lp*listeningPortsHandler)getListeningPorts() ([]codersdk.WorkspaceAgentListeningPort,error) {
7+
func (*listeningPortsHandler)getListeningPorts() ([]codersdk.WorkspaceAgentListeningPort,error) {
88
// Can't scan for ports on non-linux or non-windows_amd64 systems at the
99
// moment. The UI will not show any "no ports found" message to the user, so
1010
// the user won't suspect a thing.

‎agent/usershell/usershell_darwin.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ import (
1313
funcGet(usernamestring) (string,error) {
1414
// This command will output "UserShell: /bin/zsh" if successful, we
1515
// can ignore the error since we have fallback behavior.
16+
if!filepath.IsLocal(username) {
17+
return"",xerrors.Errorf("username is nonlocal path: %s",username)
18+
}
19+
//nolint: gosec // input checked above
1620
out,_:=exec.Command("dscl",".","-read",filepath.Join("/Users",username),"UserShell").Output()
1721
s,ok:=strings.CutPrefix(string(out),"UserShell: ")
1822
ifok {

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp