Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Follow-up: finish the goos refactor and harden callLog's zero-arg case

Aperta Adatta ai principianti
#1,106 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
65/100
Tipo di issue
Refactoring
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
go
Ambito
cli, testing

Direzione di ricerca

Esaminare in cmd_service.go le funzioni serviceIsCurrent e reportInstallSuccess per vedere dove ancora si diramano internamente in base a goos. Esaminare anche la funzione di supporto callLog in cmd_service_systemd_test.go per comprenderne il comportamento attuale di echo "$@". L'obiettivo è rifattorizzare la diramazione goos per utilizzare il parametro passato e modificare callLog in modo che produca una stringa distinguibile anche per zero argomenti. Eseguire i test di servizio esistenti per assicurarsi che le modifiche non rompano nulla.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Context

Two follow-up items surfaced during review of #1080 (the fakeSystemctl/fakeLoginctl test harness), both explicitly noted by the reviewer as out of scope for that PR:

Items
  • serviceIsCurrent (cmd_service.go) and reportInstallSuccess (cmd_service.go:498) already receive goos/runtime.GOOS as a parameter but still branch on it internally in places, the same pattern loadService/controlService/supervisorRunning/unloadService had before #1080's refactor. Their darwin-only and linux-only logic still can't be exercised from the other host. Second half of the same refactor #1080 did for the other four functions.
  • cmd_service_systemd_test.go's callLog helper writes echo "$@" to the log file; a zero-argument invocation would append a blank line, which readCallLog filters out as empty — making a real (bugged) zero-argument call indistinguishable from a genuine "never called" outcome. Latent only: no real call site in the current code passes zero arguments, so nothing exercises this today. Worth hardening (e.g. echo "argv: $@") before it silently matters.
Additional Context

Both found during the #1076/#1080 review cycle for #945 (Linux install and systemd service lifecycle verification). Neither blocks anything currently shipped; low priority.

Lingua principale
Go
Stelle
13
Fork
40
Merge medio
11h 31m
PR unite (30g)
204

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di rossoctl/cortex

Tutte le issue di rossoctl/cortex

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.