I tried to print array with brackets and commas in golang. I want to get
array like this.
["record1", "record2". "record3"]

Encode the array to JSON:

package main

import (

func main() {
        strings := [3]string{"foo", "bar", "baz"}
        stringsJson, err := json.Marshal(strings)
        if err != nil {
                log.Fatal("Cannot encode to JSON ", err)
        fmt.Fprintf(os.Stdout, "%s", stringsJson)




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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 

Reply via email to