Update readme about the version of gin (#1494)

This commit is contained in:
chainhelen 2018-08-17 14:59:55 +08:00 committed by salamer
parent 6af1a17970
commit 65a97e161f
2 changed files with 16 additions and 3 deletions

View File

@ -100,7 +100,7 @@ $ mkdir -p $GOPATH/src/github.com/myusername/project && cd "$_"
```sh
$ govendor init
$ govendor fetch github.com/gin-gonic/gin@v1.2
$ govendor fetch github.com/gin-gonic/gin@v1.3
```
4. Copy a starting template inside your project

View File

@ -18,8 +18,6 @@ import (
"testing"
"time"
"io"
"github.com/gin-contrib/sse"
"github.com/gin-gonic/gin/binding"
"github.com/golang/protobuf/proto"
@ -967,19 +965,34 @@ func TestContextRenderProtoBuf(t *testing.T) {
c, _ := CreateTestContext(w)
reps := []int64{int64(1), int64(2)}
<<<<<<< HEAD
data := &testdata.Test{
label: "test",
reps: resp,
=======
label := "test"
data := &testdata.Test{
Label: &label,
Reps: reps,
>>>>>>> 4624389... add protobuf render test
}
c.ProtoBuf(201, data)
<<<<<<< HEAD
data, err := proto.Marshal(test)
assert.NoError(t, err)
assert.Equal(t, 201, w.Code)
assert.Equal(t, data, w.Body.String())
=======
protoData, err := proto.Marshal(data)
assert.NoError(t, err)
assert.Equal(t, 201, w.Code)
assert.Equal(t, string(protoData[:]), w.Body.String())
>>>>>>> 4624389... add protobuf render test
assert.Equal(t, "application/x-protobuf", w.HeaderMap.Get("Content-Type"))
}