This repository was archived by the owner on Apr 21, 2026. It is now read-only.
Description https://protobuf.dev/programming-guides/encoding#packed
using this file:
package main
import (
"google.golang.org/protobuf/testing/protopack"
"os"
)
func main () {
inBytes := protopack.Message {
protopack.Tag {3 , protopack .BytesType }, protopack.LengthPrefix {
protopack .Float32 (1.1 ),
protopack .Float32 (2.2 ),
protopack .Float32 (3.3 ),
},
}.Marshal ()
os .WriteFile ("packed.bin" , inBytes , 0666 )
}
https://google.golang.org/protobuf/testing/protopack#Message.Marshal
if I try to scan:
package main
import (
"github.com/protocolbuffers/protoscope"
"os"
)
func main () {
inBytes , err := os .ReadFile ("packed.bin" )
if err != nil {
panic (err )
}
scanner := protoscope .NewScanner (string (inBytes ))
if _ , err := scanner .Exec (); err != nil {
panic (err )
}
}
I get this result:
panic: unrecognized symbol "\x1a\f\xcď?\xcd\xcc\f@33S@"
the tool works:
> protoscope packed.bin
3: {`cdcc8c3fcdcc0c4033335340`}
but neither the module or tool seem to have an option for dealing with this. I check WriterOptions but didn't see anything:
https://pkg.go.dev/github.com/protocolbuffers/protoscope#WriterOptions
Reactions are currently unavailable
https://protobuf.dev/programming-guides/encoding#packed
using this file:
https://google.golang.org/protobuf/testing/protopack#Message.Marshal
if I try to scan:
I get this result:
the tool works:
but neither the module or tool seem to have an option for dealing with this. I check WriterOptions but didn't see anything:
https://pkg.go.dev/github.com/protocolbuffers/protoscope#WriterOptions