Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
modify markdown style
  • Loading branch information
JessonChan committed Apr 27, 2015
1 parent 800514c commit 7b5a732
Showing 1 changed file with 51 additions and 51 deletions.
102 changes: 51 additions & 51 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,60 +1,60 @@
# jsun
this is a go json tool like encode/json but allow you to use camelName/CamelName or under_score name style
`
package main

import (
"fmt"
package main

import (
"fmt"

"github.com/JessonChan/jsun"
)

type Person struct {
Id int
FirstName string
LastName string `json:"name"`
}

func main() {
p := Person{
Id: 1,
FirstName: "FirstName",
LastName: "LastName",
}
jsun.UnderScoreStyle()
b, _ := jsun.Marshal(&p)
fmt.Println(string(b))
}

"github.com/JessonChan/jsun"
)

type Person struct {
Id int
FirstName string
LastName string `json:"name"`
}

func main() {
p := Person{
Id: 1,
FirstName: "FirstName",
LastName: "LastName",
}
jsun.UnderScoreStyle()
b, _ := jsun.Marshal(&p)
fmt.Println(string(b))
}
`
output
{"id":1,"first_name":"FirstName","name":"LastName"}

`
package main

import (
"fmt"
> {"id":1,"first_name":"FirstName","name":"LastName"}

package main

import (
"fmt"

"github.com/JessonChan/jsun"
)

type Person struct {
Id int
FirstName string
LastName string `json:"name"`
}

func main() {
p := Person{
Id: 1,
FirstName: "FirstName",
LastName: "LastName",
}
b, _ := jsun.Marshal(&p)
fmt.Println(string(b))
}

"github.com/JessonChan/jsun"
)

type Person struct {
Id int
FirstName string
LastName string `json:"name"`
}

func main() {
p := Person{
Id: 1,
FirstName: "FirstName",
LastName: "LastName",
}
b, _ := jsun.Marshal(&p)
fmt.Println(string(b))
}
`
output
{"id":1,"firstName":"FirstName","name":"LastName"}


> {"id":1,"firstName":"FirstName","name":"LastName"}

0 comments on commit 7b5a732

Please sign in to comment.