Skip to content

Private fields bugs when renaming #260

Closed
@gobigshark

Description

@gobigshark

Failed to support private fields when renaming.

`package main

import (
"fmt"

jsoniter "github.com/json-iterator/go"
"github.com/json-iterator/go/extra"

)

func main() {
extra.SupportPrivateFields()
type TestObject struct {
field string json:"myfield"
}
obj := TestObject{}
jsoniter.UnmarshalFromString({"myfield":"Hello"}, &obj)
fmt.Println(obj.field) // Output empty string instead of "Hello"
}`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions