mirror of
https://github.com/gin-gonic/gin.git
synced 2025-10-23 01:57:55 +08:00
Update readme about the version of gin (#1494)
This commit is contained in:
parent
6af1a17970
commit
65a97e161f
@ -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
|
||||
|
@ -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"))
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user