commit 373a550c4884c47937a298196a09ed4b2d9dba27 from: Dustin Sallings date: Sun Nov 02 22:16:59 2014 UTC Comment consistency++ commit - c0724757978d0404c6bb39e7bc8d29f5da803059 commit + 373a550c4884c47937a298196a09ed4b2d9dba27 blob - 9f2baf575cfb23d41b69a848ffeda6fa6aa48237 blob + 57c3bd1f21df07fea160bf36a0e969007fd76d02 --- examples/client/exampleclient.go +++ examples/client/exampleclient.go @@ -40,28 +40,33 @@ func main() { _, _, err = c.Command("mode reader", 2) maybefatal("setting reader mode", err) + // Select a group g, err := c.Group("misc.test") maybefatal("grouping", err) log.Printf("Got %#v", g) + // List the gruop n, id, r, err := c.Head(strconv.FormatInt(g.High-1, 10)) maybefatal("getting head", err) log.Printf("msg %d has id %v and the following headers", n, id) _, err = io.Copy(os.Stdout, r) maybefatal("reading head", err) + // Get an article body n, id, r, err = c.Body(strconv.FormatInt(n, 10)) maybefatal("getting body", err) log.Printf("Body of message %v", id) io.Copy(os.Stdout, r) maybefatal("reading body", err) + // Get a full article n, id, r, err = c.Article(strconv.FormatInt(n, 10)) maybefatal("getting the whole thing", err) log.Printf("Full message %v", id) io.Copy(os.Stdout, r) maybefatal("reading the full message", err) + // Post an article err = c.Post(strings.NewReader(examplepost)) maybefatal("posting", err) log.Printf("Posted!")