Skip to content
This repository has been archived by the owner on May 30, 2021. It is now read-only.

Commit

Permalink
make json key lower #85
Browse files Browse the repository at this point in the history
  • Loading branch information
sotetsuk committed May 8, 2016
1 parent c2c154e commit 05fda31
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
24 changes: 12 additions & 12 deletions article.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,26 @@ import (

// Article stores the parsed results from Google Scholar.
type Article struct {
Title *Title
Year string
ClusterId string
NumCite string
NumVer string
InfoId string
Link *Link
Title *Title `json:"title"`
Year string `json:"year"`
ClusterId string `json:"cluster_id"`
NumCite string `json:"num_cite"`
NumVer string `json:"num_ver"`
InfoId string `json:"info_id"`
Link *Link `json:"link"`
}

// Title is an attribute of Article.
type Title struct {
Name string
Url string
Name string `json:"name"`
Url string `json:"url"`
}

// Link is an attribute of Article
type Link struct {
Name string
Url string
Format string
Name string `json:"name"`
Url string `json:"url"`
Format string `json:"format"`
}

// NewArticle creates an Article in which all entry is blank.
Expand Down
2 changes: 1 addition & 1 deletion article_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ func ExampleString() {
func ExampleJson() {
fmt.Println(article.Json())
// Output:
// {"Title":{"Name":"Deep learning via Hessian-free optimization","Url":"http://machinelearning.wustl.edu/mlpapers/paper_files/icml2010_Martens10.pdf"},"Year":"2010","ClusterId":"15502119379559163003","NumCite":"260","NumVer":"9","InfoId":"e6RSJHGXItcJ","Link":{"Name":"wustl.edu","Url":"http://machinelearning.wustl.edu/mlpapers/paper_files/icml2010_Martens10.pdf","Format":"PDF"}}
// {"title":{"name":"Deep learning via Hessian-free optimization","url":"http://machinelearning.wustl.edu/mlpapers/paper_files/icml2010_Martens10.pdf"},"year":"2010","cluster_id":"15502119379559163003","num_cite":"260","num_ver":"9","info_id":"e6RSJHGXItcJ","link":{"name":"wustl.edu","url":"http://machinelearning.wustl.edu/mlpapers/paper_files/icml2010_Martens10.pdf","format":"PDF"}}
}

func TestIsValid(t *testing.T) {
Expand Down

0 comments on commit 05fda31

Please sign in to comment.