linux:scribble
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | Next revisionBoth sides next revision | ||
linux:scribble [2015/11/26 04:40] – how to resize loop-AES partition stybla | linux:scribble [2015/11/28 01:54] – add golang and JSON stybla | ||
---|---|---|---|
Line 167: | Line 167: | ||
'' | '' | ||
+ | |||
+ | ===== Go ===== | ||
+ | |||
+ | Aka golang | ||
+ | |||
+ | ==== JSON ==== | ||
+ | |||
+ | Remember that struct attributes/ | ||
+ | |||
+ | <file golang json_test.go> | ||
+ | package main | ||
+ | |||
+ | import ( | ||
+ | " | ||
+ | " | ||
+ | ) | ||
+ | |||
+ | // Attributes, eg. Name, must begin with capital letter/ | ||
+ | // Also, JSON mapping is shown. | ||
+ | type Message struct { | ||
+ | Name string `json:" | ||
+ | Body string `json:" | ||
+ | Time int64 `json:" | ||
+ | } | ||
+ | |||
+ | func main() { | ||
+ | m := Message{" | ||
+ | b, err := json.Marshal(m) | ||
+ | fmt.Println(err) | ||
+ | fmt.Println(string(b)) | ||
+ | } | ||
+ | </ | ||
===== iconv ===== | ===== iconv ===== |
linux/scribble.txt · Last modified: 2022/07/06 17:27 by stybla