Skip to content

Instantly share code, notes, and snippets.

@s1s1ty
Created July 18, 2018 17:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save s1s1ty/436b2e5f5de2fba93081269d262b8f33 to your computer and use it in GitHub Desktop.
Save s1s1ty/436b2e5f5de2fba93081269d262b8f33 to your computer and use it in GitHub Desktop.
model
type Post struct {
ID int `json: "id"`
Title string `json: "title"`
Content string `json: "content"`
}
@php-coder
Copy link

JFYI: there is a bug -- there should be no space after json keyword, otherwise it's being ignored.

-`json: "id"`
+`json:"id"`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment