初级会员
  • 第 3012 位会员
  • CodyGuo
  • guoxiao219@126.com
  • 2015-06-15 20:23:50
  • Offline
  • 20 20

最近分享的资源

    暂无

最近发布的项目

    暂无

最近的评论

  • ``` package main import ( "log" "strings" "github.com/lxn/walk" . "github.com/lxn/walk/declarative" ) type MyMainWindow struct { *walk.MainWindow textEdit *walk.TextEdit } func main() { mw := new(MyMainWindow) if err := (MainWindow{ AssignTo: &mw.MainWindow, Title: "Walk DropFiles Example", MinSize: Size{320, 300}, Layout: VBox{MarginsZero: true}, Children: []Widget{ TextEdit{ ReadOnly: true, Text: "No drop files...", }, TextEdit{ AssignTo: &mw.textEdit, ReadOnly: true, Text: "Drop files here, from windows explorer...", }, }, }.Create()); err != nil { log.Fatal(err) } mw.textEdit.DropFiles().Attach(func(files []string) { mw.textEdit.SetText(strings.Join(files, "\r\n")) }) mw.Run() } ```
  • 那可以贴出你php的解析方法吗?参考一下
  • 写了一个很长很长的,不知道行不行。 ``` package main import ( "encoding/json" "fmt" "io/ioutil" "log" "os" ) type Root struct { Took int `json:"took"` Timeout bool `json:"timed_out"` Shards Shard `json:"_shards"` Hits Hit `json:"hits"` Aggregations Aggregation `json:"aggregations"` } type Shard struct { Total int `json:"total"` Successful int `json:"successful"` Failed int `json:"failed"` } type Hit struct { Total int `json:"total"` MaxScore int `json:"max_score"` Hits []Hit `json:"hits"` } type Aggregation struct { DR DayRaw `json:"day.raw"` } type DayRaw struct { Dceub int `json:"doc_count_error_upper_bound"` Sodc int `json:"sum_other_doc_count"` Buckets []DayBucket `json:"buckets"` } type DayBucket struct { Key string `json:"key"` Dc int `json:"doc_count"` ChanRaw ChannelRaw `json:"channel.raw"` } type ChannelRaw struct { Dceub int `json:"doc_count_error_upper_bound"` Sodc int `json:"sum_other_doc_count"` Buckets []ChanBucket `json:"buckets"` } type ChanBucket struct { Key string `json:"key"` Dc int `json:"doc_count"` ActtRaw ActtypeRaw `json:"acttype.raw"` } type ActtypeRaw struct { Dceub int `json:"doc_count_error_upper_bound"` Sodc int `json:"sum_other_doc_count"` Buckets []ActtBucket `json:"buckets"` } type ActtBucket struct { Key string `json:"key"` Dc int `json:"doc_count"` Ct Ct `json:"ct"` } type Ct struct { Value int `json:"value"` } func main() { f, err := os.Open("json.log") checkErr(err) data, err := ioutil.ReadAll(f) checkErr(err) var root Root err = json.Unmarshal(data, &root) checkErr(err) result, err := json.MarshalIndent(&root, "", " ") checkErr(err) fmt.Printf("%s\n", result) } func checkErr(err error) { if err != nil { log.Fatal(err) } } ```
  • 发出你的头文件和dll
  • #6 @user_studygo 最简单的就是fmt.Scan ,类似于pause的功能参考http://blog.csdn.net/codyguo/article/details/51736946