FAQ
She has an assignment to marshal types to JSON using reflect, i.e. no encoding/json. This part looks like dealing with the fact that JSON elements are comma-separated rather than comma-terminated.

{strings,bytes}.Join might be an easy way to get what is wanted.

On 25/01/2014, at 8:06 AM, "Francesc Campoy Flores" wrote:

What are you trying to do exactly?


On Fri, Jan 24, 2014 at 9:56 AM, kate Fernando wrote:

hi,

In the below example there is no "," in the last field.How can I find it?the code that I wrote is below..



"indirizzo": {
           "-tipo": "casa",
           "#text": "Viale Carlo Espinasse 5, Como"
         },


if e.Field(i).Kind() == reflect.String {


             fmt.Printf("%q : ", strings.ToLower(e.Type().Field(i).Name))

             fmt.Printf("\"%s\"", e.Field(i).Interface())

             fmt.Printf(",")


         }


--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com .
For more options, visit https://groups.google.com/groups/opt_out.



--
--
Francesc Campoy
http://campoy.cat

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com .
For more options, visit https://groups.google.com/groups/opt_out.

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Search Discussions

Discussion Posts

Previous

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 4 of 5 | next ›
Discussion Overview
groupgolang-nuts @
categoriesgo
postedJan 24, '14 at 5:56p
activeJan 25, '14 at 1:51a
posts5
users3
websitegolang.org

People

Translate

site design / logo © 2022 Grokbase