File: main_test.go

package info (click to toggle)
golang-github-segmentio-encoding 0.5.3-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 14,468 kB
  • sloc: makefile: 286
file content (23 lines) | stat: -rw-r--r-- 305 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
package main

import (
	"bytes"
	"fmt"
	"testing"

	"github.com/segmentio/encoding/json"
)

func TestIssue18(t *testing.T) {
	b := []byte(`{
	"userId": "blah",
	}`)

	d := json.NewDecoder(bytes.NewReader(b))

	var a struct {
		UserId string `json:"userId"`
	}
	fmt.Println(d.Decode(&a))
	fmt.Println(a)
}