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

fix: appease linter on darwin#11154

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
spikecurtis merged 1 commit intomainfromspike/linter-darwin
Dec 12, 2023
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletionsagent/agentproc/proc_other.go
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -7,18 +7,18 @@ import (
"github.com/spf13/afero"
)

func (p*Process) Niceness(scSyscaller) (int, error) {
func (*Process) Niceness(Syscaller) (int, error) {
return 0, errUnimplemented
}

func (p*Process) SetNiceness(scSyscaller, score int) error {
func (*Process) SetNiceness(Syscaller, int) error {
return errUnimplemented
}

func (p*Process) Cmd() string {
func (*Process) Cmd() string {
return ""
}

func List(fsafero.Fs, syscaller Syscaller) ([]*Process, error) {
func List(afero.Fs, Syscaller) ([]*Process, error) {
return nil, errUnimplemented
}
1 change: 1 addition & 0 deletionsagent/agentproc/syscaller.go
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -10,6 +10,7 @@ type Syscaller interface {
Kill(pid int32, sig syscall.Signal) error
}

// nolint: unused // used on some but no all platforms
const defaultProcDir = "/proc"

type Process struct {
Expand Down
6 changes: 3 additions & 3 deletionsagent/agentproc/syscaller_other.go
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -17,14 +17,14 @@ var errUnimplemented = xerrors.New("unimplemented")

type nopSyscaller struct{}

func (nopSyscaller) SetPriority(pidint32, priority int) error {
func (nopSyscaller) SetPriority(int32, int) error {
return errUnimplemented
}

func (nopSyscaller) GetPriority(pidint32) (int, error) {
func (nopSyscaller) GetPriority(int32) (int, error) {
return 0, errUnimplemented
}

func (nopSyscaller) Kill(pidint32, sig syscall.Signal) error {
func (nopSyscaller) Kill(int32, syscall.Signal) error {
return errUnimplemented
}
3 changes: 2 additions & 1 deletionagent/agentssh/jetbrainstrack.go
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -4,10 +4,11 @@ import (
"strings"
"sync"

"cdr.dev/slog"
"github.com/gliderlabs/ssh"
"go.uber.org/atomic"
gossh "golang.org/x/crypto/ssh"

"cdr.dev/slog"
)

// localForwardChannelData is copied from the ssh package.
Expand Down
2 changes: 1 addition & 1 deletionagent/agentssh/portinspection_unsupported.go
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -2,7 +2,7 @@

package agentssh

func getListeningPortProcessCmdline(portuint32) (string, error) {
func getListeningPortProcessCmdline(uint32) (string, error) {
// We are not worrying about other platforms at the moment because Gateway
// only supports Linux anyway.
return "", nil
Expand Down
5 changes: 4 additions & 1 deletionagent/api.go
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -44,8 +44,11 @@ type listeningPortsHandler struct {
ignorePorts map[int]string
cacheDuration time.Duration

mut sync.Mutex
//nolint: unused // used on some but not all platforms
mut sync.Mutex
//nolint: unused // used on some but not all platforms
ports []codersdk.WorkspaceAgentListeningPort
//nolint: unused // used on some but not all platforms
mtime time.Time
}

Expand Down
2 changes: 1 addition & 1 deletionagent/ports_unsupported.go
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -4,7 +4,7 @@ package agent

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

func (lp*listeningPortsHandler) getListeningPorts() ([]codersdk.WorkspaceAgentListeningPort, error) {
func (*listeningPortsHandler) getListeningPorts() ([]codersdk.WorkspaceAgentListeningPort, error) {
// Can't scan for ports on non-linux or non-windows_amd64 systems at the
// moment. The UI will not show any "no ports found" message to the user, so
// the user won't suspect a thing.
Expand Down
4 changes: 4 additions & 0 deletionsagent/usershell/usershell_darwin.go
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -13,6 +13,10 @@ import (
func Get(username string) (string, error) {
// This command will output "UserShell: /bin/zsh" if successful, we
// can ignore the error since we have fallback behavior.
if !filepath.IsLocal(username) {
return "", xerrors.Errorf("username is nonlocal path: %s", username)
}
//nolint: gosec // input checked above
out, _ := exec.Command("dscl", ".", "-read", filepath.Join("/Users", username), "UserShell").Output()
s, ok := strings.CutPrefix(string(out), "UserShell: ")
if ok {
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp