Run gofmt -s to simplifiy.

This commit is contained in:
Aren Patel 2017-09-13 12:59:59 -07:00
parent 8d89a9020f
commit a06052dd83
No known key found for this signature in database
GPG Key ID: 90489CDA50BCDE34
3 changed files with 37 additions and 37 deletions

View File

@ -8,31 +8,31 @@ func fixtureBlogCreate(i int) *Blog {
Title: "Title 1", Title: "Title 1",
CreatedAt: time.Now(), CreatedAt: time.Now(),
Posts: []*Post{ Posts: []*Post{
&Post{ {
ID: 1 * i, ID: 1 * i,
Title: "Foo", Title: "Foo",
Body: "Bar", Body: "Bar",
Comments: []*Comment{ Comments: []*Comment{
&Comment{ {
ID: 1 * i, ID: 1 * i,
Body: "foo", Body: "foo",
}, },
&Comment{ {
ID: 2 * i, ID: 2 * i,
Body: "bar", Body: "bar",
}, },
}, },
}, },
&Post{ {
ID: 2 * i, ID: 2 * i,
Title: "Fuubar", Title: "Fuubar",
Body: "Bas", Body: "Bas",
Comments: []*Comment{ Comments: []*Comment{
&Comment{ {
ID: 1 * i, ID: 1 * i,
Body: "foo", Body: "foo",
}, },
&Comment{ {
ID: 3 * i, ID: 3 * i,
Body: "bas", Body: "bas",
}, },
@ -44,11 +44,11 @@ func fixtureBlogCreate(i int) *Blog {
Title: "Foo", Title: "Foo",
Body: "Bar", Body: "Bar",
Comments: []*Comment{ Comments: []*Comment{
&Comment{ {
ID: 1 * i, ID: 1 * i,
Body: "foo", Body: "foo",
}, },
&Comment{ {
ID: 2 * i, ID: 2 * i,
Body: "bar", Body: "bar",
}, },

View File

@ -753,7 +753,7 @@ func samplePayload() io.Reader {
Relationships: map[string]interface{}{ Relationships: map[string]interface{}{
"posts": &RelationshipManyNode{ "posts": &RelationshipManyNode{
Data: []*Node{ Data: []*Node{
&Node{ {
Type: "posts", Type: "posts",
Attributes: map[string]interface{}{ Attributes: map[string]interface{}{
"title": "Foo", "title": "Foo",
@ -761,7 +761,7 @@ func samplePayload() io.Reader {
}, },
ClientID: "1", ClientID: "1",
}, },
&Node{ {
Type: "posts", Type: "posts",
Attributes: map[string]interface{}{ Attributes: map[string]interface{}{
"title": "X", "title": "X",
@ -782,14 +782,14 @@ func samplePayload() io.Reader {
Relationships: map[string]interface{}{ Relationships: map[string]interface{}{
"comments": &RelationshipManyNode{ "comments": &RelationshipManyNode{
Data: []*Node{ Data: []*Node{
&Node{ {
Type: "comments", Type: "comments",
Attributes: map[string]interface{}{ Attributes: map[string]interface{}{
"body": "Great post!", "body": "Great post!",
}, },
ClientID: "4", ClientID: "4",
}, },
&Node{ {
Type: "comments", Type: "comments",
Attributes: map[string]interface{}{ Attributes: map[string]interface{}{
"body": "Needs some work!", "body": "Needs some work!",
@ -866,16 +866,16 @@ func testModel() *Blog {
Title: "Title 1", Title: "Title 1",
CreatedAt: time.Now(), CreatedAt: time.Now(),
Posts: []*Post{ Posts: []*Post{
&Post{ {
ID: 1, ID: 1,
Title: "Foo", Title: "Foo",
Body: "Bar", Body: "Bar",
Comments: []*Comment{ Comments: []*Comment{
&Comment{ {
ID: 1, ID: 1,
Body: "foo", Body: "foo",
}, },
&Comment{ {
ID: 2, ID: 2,
Body: "bar", Body: "bar",
}, },
@ -885,16 +885,16 @@ func testModel() *Blog {
Body: "foo", Body: "foo",
}, },
}, },
&Post{ {
ID: 2, ID: 2,
Title: "Fuubar", Title: "Fuubar",
Body: "Bas", Body: "Bas",
Comments: []*Comment{ Comments: []*Comment{
&Comment{ {
ID: 1, ID: 1,
Body: "foo", Body: "foo",
}, },
&Comment{ {
ID: 3, ID: 3,
Body: "bas", Body: "bas",
}, },
@ -910,11 +910,11 @@ func testModel() *Blog {
Title: "Foo", Title: "Foo",
Body: "Bar", Body: "Bar",
Comments: []*Comment{ Comments: []*Comment{
&Comment{ {
ID: 1, ID: 1,
Body: "foo", Body: "foo",
}, },
&Comment{ {
ID: 2, ID: 2,
Body: "bar", Body: "bar",
}, },

View File

@ -11,7 +11,7 @@ import (
func TestMarshalPayload(t *testing.T) { func TestMarshalPayload(t *testing.T) {
book := &Book{ID: 1} book := &Book{ID: 1}
books := []*Book{book, &Book{ID: 2}} books := []*Book{book, {ID: 2}}
var jsonData map[string]interface{} var jsonData map[string]interface{}
// One // One
@ -623,11 +623,11 @@ func TestMarshalPayloadWithoutIncluded(t *testing.T) {
Title: "Foo", Title: "Foo",
Body: "Bar", Body: "Bar",
Comments: []*Comment{ Comments: []*Comment{
&Comment{ {
ID: 20, ID: 20,
Body: "First", Body: "First",
}, },
&Comment{ {
ID: 21, ID: 21,
Body: "Hello World", Body: "Hello World",
}, },
@ -660,12 +660,12 @@ func TestMarshalPayload_many(t *testing.T) {
Title: "Title 1", Title: "Title 1",
CreatedAt: time.Now(), CreatedAt: time.Now(),
Posts: []*Post{ Posts: []*Post{
&Post{ {
ID: 1, ID: 1,
Title: "Foo", Title: "Foo",
Body: "Bar", Body: "Bar",
}, },
&Post{ {
ID: 2, ID: 2,
Title: "Fuubar", Title: "Fuubar",
Body: "Bas", Body: "Bas",
@ -682,12 +682,12 @@ func TestMarshalPayload_many(t *testing.T) {
Title: "Title 2", Title: "Title 2",
CreatedAt: time.Now(), CreatedAt: time.Now(),
Posts: []*Post{ Posts: []*Post{
&Post{ {
ID: 3, ID: 3,
Title: "Foo", Title: "Foo",
Body: "Bar", Body: "Bar",
}, },
&Post{ {
ID: 4, ID: 4,
Title: "Fuubar", Title: "Fuubar",
Body: "Bas", Body: "Bas",
@ -770,8 +770,8 @@ func TestMarshalManyWithoutIncluded(t *testing.T) {
func TestMarshalMany_SliceOfInterfaceAndSliceOfStructsSameJSON(t *testing.T) { func TestMarshalMany_SliceOfInterfaceAndSliceOfStructsSameJSON(t *testing.T) {
structs := []*Book{ structs := []*Book{
&Book{ID: 1, Author: "aren55555", ISBN: "abc"}, {ID: 1, Author: "aren55555", ISBN: "abc"},
&Book{ID: 2, Author: "shwoodard", ISBN: "xyz"}, {ID: 2, Author: "shwoodard", ISBN: "xyz"},
} }
interfaces := []interface{}{} interfaces := []interface{}{}
for _, s := range structs { for _, s := range structs {
@ -823,16 +823,16 @@ func testBlog() *Blog {
Title: "Title 1", Title: "Title 1",
CreatedAt: time.Now(), CreatedAt: time.Now(),
Posts: []*Post{ Posts: []*Post{
&Post{ {
ID: 1, ID: 1,
Title: "Foo", Title: "Foo",
Body: "Bar", Body: "Bar",
Comments: []*Comment{ Comments: []*Comment{
&Comment{ {
ID: 1, ID: 1,
Body: "foo", Body: "foo",
}, },
&Comment{ {
ID: 2, ID: 2,
Body: "bar", Body: "bar",
}, },
@ -842,16 +842,16 @@ func testBlog() *Blog {
Body: "foo", Body: "foo",
}, },
}, },
&Post{ {
ID: 2, ID: 2,
Title: "Fuubar", Title: "Fuubar",
Body: "Bas", Body: "Bas",
Comments: []*Comment{ Comments: []*Comment{
&Comment{ {
ID: 1, ID: 1,
Body: "foo", Body: "foo",
}, },
&Comment{ {
ID: 3, ID: 3,
Body: "bas", Body: "bas",
}, },
@ -867,11 +867,11 @@ func testBlog() *Blog {
Title: "Foo", Title: "Foo",
Body: "Bar", Body: "Bar",
Comments: []*Comment{ Comments: []*Comment{
&Comment{ {
ID: 1, ID: 1,
Body: "foo", Body: "foo",
}, },
&Comment{ {
ID: 2, ID: 2,
Body: "bar", Body: "bar",
}, },