Created
April 10, 2016 14:01
-
-
Save bgnori/ed0dd6e402781c68bad8bca15df2cc27 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"encoding/json" | |
"fmt" | |
"os" | |
) | |
type LINEContent struct { | |
ToType int `json:"toType"` | |
CreatedTime int `json:"createdTime"` | |
From string `json:"from"` | |
Id string `json:"id"` | |
To []string `json:"to"` | |
ContentMetadata map[string]string `json:"contentMetadata"` | |
Location string `json:"Location"` | |
Text string `json:"text"` | |
ContentType int `json:"contentType"` | |
Seq string `json:"seq"` | |
} | |
type LINEResultItem struct { | |
Id string `json:"id"` | |
CreatedTime int `json:"createdTime"` | |
EventType string `json:"eventType"` | |
From string `json:"from"` | |
FromChannel int `json:"fromChannel"` | |
ToChannel int `json:"toChannel"` | |
To []string `json:"to"` | |
Content LINEContent `json:"content"` | |
} | |
type LINEPack struct { | |
Result []LINEResultItem `json:"result"` | |
} | |
func main() { | |
var x LINEPack | |
var i int | |
i = 1462499114 | |
fmt.Printf("%d\n", i) | |
decoder := json.NewDecoder(os.Stdin) | |
decoder.Decode(&x) | |
fmt.Printf("%+v\n", x) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment