Environment
- Go Version:
go version go1.25.1 darwin/amd64
- Sonic Version:
v1.13.3
- OS: macOS
Steps to Reproduce
- Create a new Go project.
- Add
github.com/bytedance/[email protected] as a dependency.
- Use the following code in
main.go:
package main
import (
"fmt"
"github.com/bytedance/sonic"
)
type Test struct {
A string
B int
}
func main() {
t := Test{A: "hello", B: 1}
b, err := sonic.MarshalString(t)
if err != nil {
panic(err)
}
fmt.Println(b)
}
- Run the program using
go run ..
Expected Behavior
The program should compile and run successfully, printing the JSON representation of the Test struct.
Actual Behavior
The compilation fails with the following error:
# github.com/bytedance/sonic/internal/rt
../../../../go/pkg/mod/github.com/bytedance/[email protected]/internal/rt/stubs.go:33:22: undefined: GoMapIterator
../../../../go/pkg/mod/github.com/bytedance/[email protected]/internal/rt/stubs.go:36:54: undefined: GoMapIterator