[go-nuts] Re: How to correctly json.Unmarshal struct whose embedded structs define UnmarshalJSON

2020-01-01 Thread Ben Bullock
On Thursday, 2 January 2020 15:01:15 UTC+9, Glen Huang wrote: > > @Ben > > My real world use case is that I have these types that dealing with user > signing up/loging in > > type LogIn struct { > Name string > Password string > } > > type SignUp struct { > Name string > Password string

[go-nuts] Re: How to correctly json.Unmarshal struct whose embedded structs define UnmarshalJSON

2020-01-01 Thread Ben Bullock
On Tuesday, 31 December 2019 19:21:07 UTC+9, Glen Huang wrote: > > I want to unmarshal a struct that contains embedded structs: > > type Parent struct { > Child > P int > } > > > type Child struct { > Grandchild > C int > } > > > type Grandchild struct { > G int > } > > The problem is that

[go-nuts] Re: why golang unicode katakana table don't include 0x30fc ..

2019-12-10 Thread Ben Bullock
These properties come from the Unicode definitions in the file Scripts.txt, not from the Go language. It is the same in Perl, \p{Katakana} does not match U+30FB or U+30FC, but \p{InKatakana} does, similarly with U+30A0. Here is the relevant portion of Scripts.txt: 30A1..30FA; Katakana # Lo

[go-nuts] Re: Avoiding html/template's escaping of the + in

2018-04-22 Thread Ben Bullock
On Sunday, 1 April 2018 05:47:09 UTC+9, iv...@vucica.net wrote: > > > This still gets escaped: > > https://play.golang.org/p/eZxQrHy1vCE > > Is this a bug? How do I avoid html/template escaping this, while still > escaping > href? > Use text/template and explicitly escape the things which need