#1702·yaegi

Cannot use protobuf

Author: darkweakCreated Aug 2, 2025Updated Jan 5, 2026

The following program sample.go triggers an unexpected result

go
package main

var item = []byte(`YOUR_PB_BYTE`)

func main() {
	mapping := &StorageMapper{}
	if len(item) != 0 {
		e = proto.Unmarshal(item, mapping)
		if e != nil {
			panic(e)
		}
	}
}

Expected result

bash
It should run

Got

bash
CFG post-order panic: runtime error: index out of range [1] with length 0

Yaegi Version

latest

Additional Notes

No response