You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
package main
/* - Utilizando este código: https://play.golang.org/p/3W69TH4nON
- ...remova o underscore e verifique e lide com o erro de maneira apropriada. */
import (
"encoding/json"
"fmt"
"log"
)
type person struct {
First string
Last string
Sayings []string
}
func main() {
p1 := person{
First: "James",
Last: "Bond",
Sayings: []string{"Shaken, not stirred", "Any last wishes?", "Never say never"},
}
bs, err := json.Marshal(p1)
if err != nil {
log.Println("Exist error", err)
}
fmt.Println(string(bs))
}
Output
{"First":"James","Last":"Bond","Sayings":["Shaken, not stirred","Any last wishes?","Never say never"]}
Program exited.
Exercício: Capítulo 24, Exercício 1 (Nível: 11)
Use esta thread para compartilhar sua solução, discutir o exercício com os colegas e pedir ajuda caso tenha dificuldades!
The text was updated successfully, but these errors were encountered: