Browse Source

Fix examples in README

tags/v1.1^0
Matt Baer 5 years ago
parent
commit
cf3c150ac9
1 changed files with 11 additions and 7 deletions
  1. +11
    -7
      README.md

+ 11
- 7
README.md View File

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


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


// Update a published post // 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!", Content: "Now it's been updated!",
}) })
if err != nil { if err != nil {
@@ -53,9 +55,11 @@ func main() {
} }


// Delete a post // 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…
Cancel
Save