Horje
create json in go Code Example
create json in go
package main
 
import (
    "fmt"
    "encoding/json"
)
 
type Book struct {
    Name string
    Author string
}
 
func main() {
    book := Book{"C++ programming language", "Bjarne Stroutsrup"}
    res, err := json.Marshal(book)
     
    if err != nil {
        fmt.Println(err)
    }
     
    fmt.Println(string(res))      // {"Name":"C++ programming language","Author":"Bjarne Stroutsrup"}
}

// See more in the source




Go

Related
on edit copy values to another sheet dynamically google sheets Code Example on edit copy values to another sheet dynamically google sheets Code Example
golang struct to bson.d Code Example golang struct to bson.d Code Example
golang bufio gjson Code Example golang bufio gjson Code Example
go if Code Example go if Code Example
visual studio code go Code Example visual studio code go Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
8