Skip to content

Instantly share code, notes, and snippets.

View austin-millan's full-sized avatar

Austin Millan austin-millan

View GitHub Profile
{"valA":0,"valB":1}
package main
import (
"encoding/json"
"fmt"
)
type A struct {
ValA int `json:"valA"`
ValB int `json:"valB"`
[{},{"valA":1,"valB":3}]
{"valA":0,"valB":1}
0xc00018e000
0xc00018e000
[{1 0} {2 0}]
{"valA":0,"valB":1}
package main
import (
"database/sql"
"encoding/json"
"fmt"
"strings"
"github.com/jmoiron/sqlx"
)
{"valA":99,"valB":1}
==================
WARNING: DATA RACE
Write at 0x00000066b9d0 by goroutine 8:
reflect.Value.SetInt()
/usr/local/go/src/reflect/value.go:1642 +0xfd
encoding/json.(*decodeState).literalStore()
/usr/local/go/src/encoding/json/decode.go:1002 +0x266e
encoding/json.(*decodeState).value()
/usr/local/go/src/encoding/json/decode.go:384 +0x307
package main
import (
"fmt"
)
type A struct {
ValA int `json:"valA"`
ValB int `json:"valB"`
}
package main
import (
"encoding/json"
"fmt"
)
type A struct {
ValA int `json:"valA"`
ValB int`json:"valB"`