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

netConn and msgReader should return io.EOF identically instead of wrapped

Aperta
#504 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
52/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
go
Ambito
networking

Direzione di ricerca

Individua le implementazioni di netConn e msgReader ed esamina come segnalano gli errori alla fine dell’input. Confronta il loro comportamento con il requisito di io.Reader secondo cui EOF deve essere restituito in modo identico, quindi verifica che entrambi i reader restituiscano direttamente io.EOF anziché un errore wrapped.

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

Descrizione

bug

*bufio.Scanner and other consumers of io.Reader interface expect to receive io.EOF identically when reading to the end of a file/stream.

From the io package:

// EOF is the error returned by Read when no more input is available.
// (Read must return EOF itself, not an error wrapping EOF,
// because callers will test for EOF using ==.)
// Functions should return EOF only to signal a graceful end of input.
// If the EOF occurs unexpectedly in a structured data stream,
// the appropriate error is either [ErrUnexpectedEOF] or some other error
// giving more detail.
var EOF = errors.New("EOF")

We currently wrap EOF along with any other error when reading from netConn or msgReader. Instead, we should return io.EOF identically to conform with the io.Reader spec.

Lingua principale
Go
Stelle
5.5k
Fork
377
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

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 coder/websocket

Tutte le issue di coder/websocket

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.