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

Encoding: Inconsistent example for packed repeated fields in Test4 message

Aperta
#282 1 commento 0 reazioni 1 assegnatario Vedi su GitHub

@jguamie ci sta già lavorando.

Dal 17/10/2025.

Valutazione

Questa issue non è ancora stata valutata.

Descrizione

In the documentation section about packed repeated fields, the following example is given:

message Test4 {
string d = 4;
repeated int32 e = 6;
}

The text says:

“… and we construct a Test4 message with d set to "hello", and e set to 1, 2, and 3, this could be encoded as 3206038e029ea705, or written out as Protoscope,

4: {"hello"}
6: {3 270 86942}”

Problem:
The encoding 3206038e029ea705 corresponds to e = [3, 270, 86942], not [1, 2, 3].

If e = [1, 2, 3], the correct encoding should be:

32 03 01 02 03

which expands to:

32 → field 6, wire type = length-delimited

03 → length = 3 bytes

01 02 03 → values [1, 2, 3]

The given encoding 3206038e029ea705 decodes as:

32 → field 6, wire type = length-delimited

06 → length = 6 bytes

03 → value = 3

8e 02 → value = 270

9e a7 05 → value = 86942

So the example text and the provided encoding are inconsistent.

Suggested fix:
Update the documentation so that either:

The example values match the provided encoding (e = [3, 270, 86942]), or

The encoded hex string is corrected to match the described values (e = [1, 2, 3]).

Lingua principale
HTML
Stelle
69
Fork
180
Merge medio
1g 13h
PR unite (30g)
6

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 protocolbuffers/protocolbuffers.github.io

Tutte le issue di protocolbuffers/protocolbuffers.github.io

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.