瀏覽代碼

Fix examples in README

tags/v1.1^0
Matt Baer 5 年之前
父節點
當前提交
cf3c150ac9
共有 1 個檔案被更改,包括 11 行新增7 行删除
  1. +11
    -7
      README.md

+ 11
- 7
README.md 查看文件

@@ -24,7 +24,7 @@ func main() {
c := writeas.NewClient()

// Publish a post
p, err := c.CreatePost(&PostParams{
p, err := c.CreatePost(&writeas.PostParams{
Title: "Title!",
Content: "This is a post.",
Font: "sans",
@@ -37,9 +37,11 @@ func main() {
token := p.Token

// Update a published post
p, err = c.UpdatePost(&PostParams{
ID: p.ID,
Token: token,
p, err = c.UpdatePost(&writeas.PostParams{
OwnedPostParams: writeas.OwnedPostParams{
ID: p.ID,
Token: token,
},
Content: "Now it's been updated!",
})
if err != nil {
@@ -53,9 +55,11 @@ func main() {
}

// Delete a post
err = c.DeletePost(&PostParams{
ID: p.ID,
Token: token,
err = c.DeletePost(&writeas.PostParams{
OwnedPostParams: writeas.OwnedPostParams{
ID: p.ID,
Token: token,
},
})
}
```


Loading…
取消
儲存