detached d088b64

style(platform): normalize syscall error strings

commit
d088b642bd766ba41572d09a042c1fe8f9b38770
author
brice · · 2026-07-16 18:22 UTC
parent
898d276
signature
GPG VerifiedCD88F9E564E0102646FB6077A1A07C7C7C3E349D · arch-gpg Verified for the committer email
2 files · +6 -6
M internal/platform/process.go +5 -5
@@ -34,17 +34,17 @@ func selectProcessGroupPID(recs []processRecord, pgid int, shellPid int) (int, b
3434 func parseKernProcArgs2(data []byte) ([]string, error) {
3535 const argcSize = 4
3636 if len(data) < argcSize {
37- return nil, fmt.Errorf("KERN_PROCARGS2: truncated argc")
37+ return nil, fmt.Errorf("kern_procargs2: truncated argc")
3838 }
3939 argc := int(int32(binary.LittleEndian.Uint32(data[:argcSize])))
4040 if argc <= 0 {
41- return nil, fmt.Errorf("KERN_PROCARGS2: invalid argc %d", argc)
41+ return nil, fmt.Errorf("kern_procargs2: invalid argc %d", argc)
4242 }
4343
4444 rest := data[argcSize:]
4545 execEnd := bytes.IndexByte(rest, 0)
4646 if execEnd < 0 {
47- return nil, fmt.Errorf("KERN_PROCARGS2: unterminated executable path")
47+ return nil, fmt.Errorf("kern_procargs2: unterminated executable path")
4848 }
4949 rest = rest[execEnd+1:]
5050 for len(rest) > 0 && rest[0] == 0 {
@@ -53,14 +53,14 @@ func parseKernProcArgs2(data []byte) ([]string, error) {
5353 // Each argument must contain at least its terminating NUL byte. Check this
5454 // before allocating from the kernel-provided argc.
5555 if argc > len(rest) {
56- return nil, fmt.Errorf("KERN_PROCARGS2: argc %d exceeds remaining data", argc)
56+ return nil, fmt.Errorf("kern_procargs2: argc %d exceeds remaining data", argc)
5757 }
5858
5959 argv := make([]string, 0, argc)
6060 for len(argv) < argc {
6161 end := bytes.IndexByte(rest, 0)
6262 if end < 0 {
63- return nil, fmt.Errorf("KERN_PROCARGS2: truncated argv")
63+ return nil, fmt.Errorf("kern_procargs2: truncated argv")
6464 }
6565 argv = append(argv, string(rest[:end]))
6666 rest = rest[end+1:]
@@ -34,17 +34,17 @@ func selectProcessGroupPID(recs []processRecord, pgid int, shellPid int) (int, b
34 func parseKernProcArgs2(data []byte) ([]string, error) {34 func parseKernProcArgs2(data []byte) ([]string, error) {
35 const argcSize = 435 const argcSize = 4
36 if len(data) < argcSize {36 if len(data) < argcSize {
37- return nil, fmt.Errorf("KERN_PROCARGS2: truncated argc")37+ return nil, fmt.Errorf("kern_procargs2: truncated argc")
38 }38 }
39 argc := int(int32(binary.LittleEndian.Uint32(data[:argcSize])))39 argc := int(int32(binary.LittleEndian.Uint32(data[:argcSize])))
40 if argc <= 0 {40 if argc <= 0 {
41- return nil, fmt.Errorf("KERN_PROCARGS2: invalid argc %d", argc)41+ return nil, fmt.Errorf("kern_procargs2: invalid argc %d", argc)
42 }42 }
43 43
44 rest := data[argcSize:]44 rest := data[argcSize:]
45 execEnd := bytes.IndexByte(rest, 0)45 execEnd := bytes.IndexByte(rest, 0)
46 if execEnd < 0 {46 if execEnd < 0 {
47- return nil, fmt.Errorf("KERN_PROCARGS2: unterminated executable path")47+ return nil, fmt.Errorf("kern_procargs2: unterminated executable path")
48 }48 }
49 rest = rest[execEnd+1:]49 rest = rest[execEnd+1:]
50 for len(rest) > 0 && rest[0] == 0 {50 for len(rest) > 0 && rest[0] == 0 {
@@ -53,14 +53,14 @@ func parseKernProcArgs2(data []byte) ([]string, error) {
53 // Each argument must contain at least its terminating NUL byte. Check this53 // Each argument must contain at least its terminating NUL byte. Check this
54 // before allocating from the kernel-provided argc.54 // before allocating from the kernel-provided argc.
55 if argc > len(rest) {55 if argc > len(rest) {
56- return nil, fmt.Errorf("KERN_PROCARGS2: argc %d exceeds remaining data", argc)56+ return nil, fmt.Errorf("kern_procargs2: argc %d exceeds remaining data", argc)
57 }57 }
58 58
59 argv := make([]string, 0, argc)59 argv := make([]string, 0, argc)
60 for len(argv) < argc {60 for len(argv) < argc {
61 end := bytes.IndexByte(rest, 0)61 end := bytes.IndexByte(rest, 0)
62 if end < 0 {62 if end < 0 {
63- return nil, fmt.Errorf("KERN_PROCARGS2: truncated argv")63+ return nil, fmt.Errorf("kern_procargs2: truncated argv")
64 }64 }
65 argv = append(argv, string(rest[:end]))65 argv = append(argv, string(rest[:end]))
66 rest = rest[end+1:]66 rest = rest[end+1:]
M internal/platform/process_darwin_arm64.go +1 -1
@@ -150,7 +150,7 @@ func readDarwinProcessRecords() ([]processRecord, error) {
150150 return nil, err
151151 }
152152 if len(data)%darwinKinfoProcSize != 0 {
153- return nil, fmt.Errorf("KERN_PROC_ALL returned %d bytes, not a multiple of %d", len(data), darwinKinfoProcSize)
153+ return nil, fmt.Errorf("kern_proc_all returned %d bytes, not a multiple of %d", len(data), darwinKinfoProcSize)
154154 }
155155 recs := make([]processRecord, 0, len(data)/darwinKinfoProcSize)
156156 for len(data) > 0 {
@@ -150,7 +150,7 @@ func readDarwinProcessRecords() ([]processRecord, error) {
150 return nil, err150 return nil, err
151 }151 }
152 if len(data)%darwinKinfoProcSize != 0 {152 if len(data)%darwinKinfoProcSize != 0 {
153- return nil, fmt.Errorf("KERN_PROC_ALL returned %d bytes, not a multiple of %d", len(data), darwinKinfoProcSize)153+ return nil, fmt.Errorf("kern_proc_all returned %d bytes, not a multiple of %d", len(data), darwinKinfoProcSize)
154 }154 }
155 recs := make([]processRecord, 0, len(data)/darwinKinfoProcSize)155 recs := make([]processRecord, 0, len(data)/darwinKinfoProcSize)
156 for len(data) > 0 {156 for len(data) > 0 {

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 12

Tags 11

↑↓ moveenter openesc close