Skip to content

Instantly share code, notes, and snippets.

@sahajre
Created August 1, 2019 07:56
package main
import (
"encoding/json"
"fmt"
)
type greet struct {
Output string `json:"output"`
}
func main() {
g := greet{Output: "Hello, 世界"}
b, err := json.Marshal(g)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(b))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment