google/gvisor

tcpip.Endpoint.Write() doc is out of date

Open

#6024 aperta il 19 mag 2021

Vedi su GitHub
 (6 commenti) (0 reazioni) (0 assegnatari)Go (1061 fork)batch import
area: networkinggood first issuetype: bug

Metriche repository

Star
 (12.713 star)
Metriche merge PR
 (Merge medio 6g 13h) (156 PR mergiate in 30 g)

Descrizione

The doc says

	// Unlike io.Writer.Write, Endpoint.Write transfers ownership of any bytes
	// successfully written to the Endpoint. That is, if a call to
	// Write(SlicePayload{data}) returns (n, err), it may retain data[:n], and
	// the caller should not use data[:n] after Write returns.

but the signature of Write has since changed. It no longer accepts a slice payload, so this advice is no longer applicable.

Guida contributor