File: named_type.go

package info (click to toggle)
golang-github-mailru-easyjson 0.9.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 872 kB
  • sloc: makefile: 117; sh: 4
file content (22 lines) | stat: -rw-r--r-- 548 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
package tests

//easyjson:json
type NamedType struct {
	Inner struct {
		// easyjson is mistakenly naming the type of this field 'tests.MyString' in the generated output
		// something about a named type inside an anonmymous type is triggering this bug
		Field  MyString `tag:"value"`
		Field2 int      "tag:\"value with ` in it\""
	}
}

type MyString string

var namedTypeValue NamedType

func init() {
	namedTypeValue.Inner.Field = "test"
	namedTypeValue.Inner.Field2 = 123
}

var namedTypeValueString = `{"Inner":{"Field":"test","Field2":123}}`