Skip to content

Commit

Permalink
Updating the "Encode" example in the README
Browse files Browse the repository at this point in the history
  • Loading branch information
Rican7 committed Jan 16, 2019
1 parent 13c2819 commit 277a501
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,14 +114,14 @@ model := exampleModel{
jsonEncoder := json.NewEncoder(os.Stdout)
jsonEncoder.SetIndent(marshalPrefix, marshalIndent)

conjson.NewEncoder(jsonEncoder, transform.CamelCaseKeys()).Encode(model)
conjson.NewEncoder(jsonEncoder, transform.CamelCaseKeys(false)).Encode(model)

// Output:
// {
// "title": "Example Title",
// "description": "This is a description.",
// "imageUrl": "https://example.com/image.png",
// "referredByUrl": "https://example.com/referrer/index.html",
// "imageURL": "https://example.com/image.png",
// "referredByURL": "https://example.com/referrer/index.html",
// "isActive": true,
// "createdAt": "2015-11-17T20:43:31-05:00",
// "updatedAt": "2018-12-24T13:21:15-07:00"
Expand Down

0 comments on commit 277a501

Please sign in to comment.