From 47a973a90ee52b5b1acb7ca7ffd3325c3258882c Mon Sep 17 00:00:00 2001 From: salamer Date: Sat, 18 Aug 2018 23:37:47 +0800 Subject: [PATCH] update the README code annotations, make it more clear --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index fa571224..ae183f92 100644 --- a/README.md +++ b/README.md @@ -908,12 +908,13 @@ func main() { r.GET("/someProtoBuf", func(c *gin.Context) { reps := []int64{int64(1), int64(2)} label := "test" - - // Proto specifically defines the testdata/protoexample file + // The specific definition of protobuf is written in the testdata/protoexample file. data := &protoexample.Test{ Label: &label, Reps: reps, } + // Note that data becomes binary data in the response + // Will output protoexample.Test protobuf serialized data c.ProtoBuf(http.StatusOK, data) })