Guest User

Untitled

a guest
Oct 16th, 2018
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.27 KB | None | 0 0
  1. package main
  2.  
  3. import "fmt"
  4. import "encoding/json"
  5.  
  6. type Test struct {
  7. Test1 string
  8. Test2 string `json:"special_json_name"`
  9. test3 string
  10. }
  11.  
  12. func main() {
  13. a := Test{"hi", "yeah", "can't be exported :("}
  14. a.Test2 = "whatttt!"
  15. b, _ := json.Marshal(a)
  16. fmt.Println(string(b))
  17. }
Add Comment
Please, Sign In to add comment