Re: [go-nuts] Re: float64 - xml marshalling to 2464700.000000 rather than 2.4647e+06

2018-03-31 Thread desaiabhijit
Thanks for the help if REST XML output xs:double value supports scientific notation then it's fine I will keep it as is Thanks, Abhi On Saturday, March 31, 2018 at 2:24:51 PM UTC+5:30, Jesper Louis Andersen wrote: > > The underlying question is: why do you want to use an 'f' representation >

[go-nuts] panic propagation can be blocked by blocking defer function

2018-03-31 Thread 'Yongjian Xu' via golang-nuts
This program will make panic not panicking but silently blocking forever. func panicfunc() { panic("oops") } func run() { defer func() { select {} } panicfunc() } func main() { // not trigger runtime deadlock. go func() { ticker := time.NewTicker(1

[go-nuts] asn1: tags don't match

2018-03-31 Thread andrey mirtchovski
I have a piece of valid asn.1 that i'm not able to properly parse with Go's encoding/asn.1. I have distilled the example down to: https://play.golang.org/p/YQCVxhEKnJx the asn1 code, which i generated with asn1c, is parseable by asn1c and lapo.it: http://lapo.it/asn1js/#A010A106800101810102A20680

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

2018-03-31 Thread ivan
Hi I have an HTML template where I'd like to provide tags externally. I'd like to leverage html/template's escaping for href. Therefore, it seemed easiest to just create a struct with fields for rel, href, title and type. Trying to just use string types means I get everything escaped. Surpris

Re: [go-nuts] Re: float64 - xml marshalling to 2464700.000000 rather than 2.4647e+06

2018-03-31 Thread Jesper Louis Andersen
The underlying question is: why do you want to use an 'f' representation of a floating point value rather than a 'g' representation? If I read the XML Schema specification correctly, then an xs:double value is allowed to be in scientific notation, so there should be little reason to output this va

[go-nuts] Re: float64 - xml marshalling to 2464700.000000 rather than 2.4647e+06

2018-03-31 Thread desaiabhijit
found that https://golang.org/src/encoding/xml/marshal.go library contains return strconv.FormatFloat(val.Float(), 'g', -1, val.Type().Bits()), nil, nil where 'g' is for ('e' for large exponents, 'f' otherwise) Can anyone help to know how to do this internal library function modifications