detached 7351f41

style(cef): satisfy safety marker lint

commit
7351f415ae7d16fad3f6fdcb64da1b6e3407ae14
author
brice · · 2026-07-14 06:27 UTC
committer
brice · · 2026-07-14 07:06 UTC
parent
2624fd3
signature
GPG VerifiedCD88F9E564E0102646FB6077A1A07C7C7C3E349D · arch-gpg Verified for the committer email
1 file · +8 -4
M internal/infrastructure/cef/restart_safety.go +8 -4
@@ -6,7 +6,11 @@ import (
66 "path/filepath"
77 )
88
9-const nextStartSafetyMarkerFile = "cef-next-start-safe"
9+const (
10+ nextStartSafetyMarkerFile = "cef-next-start-safe"
11+ safetyMarkerDirPerm = 0o700
12+ safetyMarkerFilePerm = 0o600
13+)
1014
1115 // writeNextStartSafetyMarker records a one-shot recovery request for the next
1216 // CEF start. The marker lives beside CEF's root cache so it follows explicit
@@ -15,7 +19,7 @@ func writeNextStartSafetyMarker(stateRoot string) error {
1519 if stateRoot == "" {
1620 return errors.New("CEF state root is empty")
1721 }
18- if err := os.MkdirAll(stateRoot, 0o700); err != nil {
22+ if err := os.MkdirAll(stateRoot, safetyMarkerDirPerm); err != nil {
1923 return err
2024 }
2125
@@ -25,8 +29,8 @@ func writeNextStartSafetyMarker(stateRoot string) error {
2529 return err
2630 }
2731 temporaryName := temporary.Name()
28- defer os.Remove(temporaryName)
29- if err := temporary.Chmod(0o600); err != nil {
32+ defer func() { _ = os.Remove(temporaryName) }()
33+ if err := temporary.Chmod(safetyMarkerFilePerm); err != nil {
3034 _ = temporary.Close()
3135 return err
3236 }
@@ -6,7 +6,11 @@ import (
6 "path/filepath"6 "path/filepath"
7 )7 )
8 8
9-const nextStartSafetyMarkerFile = "cef-next-start-safe"9+const (
10+ nextStartSafetyMarkerFile = "cef-next-start-safe"
11+ safetyMarkerDirPerm = 0o700
12+ safetyMarkerFilePerm = 0o600
13+)
10 14
11 // writeNextStartSafetyMarker records a one-shot recovery request for the next15 // writeNextStartSafetyMarker records a one-shot recovery request for the next
12 // CEF start. The marker lives beside CEF's root cache so it follows explicit16 // CEF start. The marker lives beside CEF's root cache so it follows explicit
@@ -15,7 +19,7 @@ func writeNextStartSafetyMarker(stateRoot string) error {
15 if stateRoot == "" {19 if stateRoot == "" {
16 return errors.New("CEF state root is empty")20 return errors.New("CEF state root is empty")
17 }21 }
18- if err := os.MkdirAll(stateRoot, 0o700); err != nil {22+ if err := os.MkdirAll(stateRoot, safetyMarkerDirPerm); err != nil {
19 return err23 return err
20 }24 }
21 25
@@ -25,8 +29,8 @@ func writeNextStartSafetyMarker(stateRoot string) error {
25 return err29 return err
26 }30 }
27 temporaryName := temporary.Name()31 temporaryName := temporary.Name()
28- defer os.Remove(temporaryName)32+ defer func() { _ = os.Remove(temporaryName) }()
29- if err := temporary.Chmod(0o600); err != nil {33+ if err := temporary.Chmod(safetyMarkerFilePerm); err != nil {
30 _ = temporary.Close()34 _ = temporary.Close()
31 return err35 return err
32 }36 }

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 8

Tags 42

↑↓ moveenter openesc close