json-iterator

json-iterator

Jsoniter (json-iterator) is fast and flexible JSON parser available in Java and Go

Member Since 5 years ago

Experience Points
0
follower
Lessons Completed
0
follow
Best Reply Awards
14
repos
Activity
May
19
22 hours ago
started
started time in 4 hours ago
Activity icon
fork

srruenny forked json-iterator/go

⚡ A high-performance 100% compatible drop-in replacement of "encoding/json"
srruenny MIT License Updated
fork time in 12 hours ago
started
started time in 13 hours ago
started
started time in 13 hours ago
started
started time in 14 hours ago
started
started time in 15 hours ago
started
started time in 15 hours ago
started
started time in 20 hours ago
May
18
1 day ago
started
started time in 1 day ago
started
started time in 1 day ago
started
started time in 1 day ago
started
started time in 1 day ago
May
17
2 days ago
Activity icon
fork

ekinata forked json-iterator/java

⚡ jsoniter (json-iterator) is fast and flexible JSON parser available in Java and Go
ekinata MIT License Updated
fork time in 1 day ago
started
started time in 2 days ago
started
started time in 2 days ago
May
16
3 days ago
started
started time in 3 days ago
started
started time in 3 days ago
started
started time in 3 days ago
started
started time in 3 days ago
started
started time in 3 days ago
started
started time in 3 days ago
May
15
4 days ago
started
started time in 4 days ago
started
started time in 4 days ago
started
started time in 4 days ago
Activity icon
issue

ewen-lbh issue json-iterator/go

ewen-lbh
ewen-lbh

Marshaling niladic methods on struct to their values

Is it possible, when marshaling a struct, to add fields that with values corresponding to the result of niladic methods?

An example:

type A struct {
    Foo string
    Bar string
}

type (a A) Baz() int {
    return len(a.Foo) + len(a.Bar)
}

a := A{
    Foo: "spam",
    Bar: "eggs",
}

Marshaling a would result in the following JSON:

{
    "Foo": "spam",
    "Bar": "eggs",
    "Baz": 8
}

Is it possible to achieve this behaviour? If not, can it be implemented? I'm willing to try my hand at a PR.

started
started time in 4 days ago
May
14
5 days ago
started
started time in 5 days ago
started
started time in 5 days ago
started
started time in 5 days ago
started
started time in 5 days ago
Previous