Skip to content

Conversation

guonaihong
Copy link
Contributor

package main

import (
	"github.com/gin-gonic/gin"
)

func main() {
	router := gin.Default()
	router.POST("/", func(c *gin.Context) {
		var s string
		c.BindPlain(&s)
		c.String(200, s)
	})

	router.Run()
}

// client
// curl -d "test string" 127.0.0.1:8080
// output
// test string

```go
package main

import (
	"github.com/gin-gonic/gin"
)

func main() {
	router := gin.Default()
	router.POST("/", func(c *gin.Context) {
		var s string
		c.BindPlain(&s)
		c.String(200, s)
	})

	router.Run()
}

// client
// curl -d "test string" 127.0.0.1:8080
// output
// test string
```
@codecov
Copy link

codecov bot commented Sep 4, 2019

Codecov Report

Merging #2037 into master will increase coverage by 0.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2037      +/-   ##
==========================================
+ Coverage   98.69%   98.71%   +0.01%     
==========================================
  Files          40       41       +1     
  Lines        2225     2251      +26     
==========================================
+ Hits         2196     2222      +26     
  Misses         16       16              
  Partials       13       13
Impacted Files Coverage Δ
context.go 98.45% <100%> (+0.01%) ⬆️
binding/binding.go 100% <100%> (ø) ⬆️
binding/plain.go 100% <100%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 01ca625...4afd057. Read the comment docs.

@appleboy appleboy added this to the 1.x milestone Sep 4, 2019
@guonaihong
Copy link
Contributor Author

guonaihong commented Mar 24, 2020

Can the pr review it quickly?
If you trust the client to send a json string, you just want to forward it to the next server node. There is no need to use BindJSON functions, it is more efficient to use BindPlain.

@appleboy @thinkerou

For example, using gin to develop services such as log-agent

.gitignore Outdated
@@ -1,3 +1,4 @@
*~
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

revert this

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

@appleboy appleboy modified the milestones: 1.x, 1.7 Mar 24, 2020
@appleboy appleboy requested a review from thinkerou March 24, 2020 03:25
@appleboy
Copy link
Member

move to 1.7 milestone

@thinkerou thinkerou modified the milestones: 1.7, v1.8 Nov 8, 2020
@thinkerou thinkerou modified the milestones: v1.8, v1.9 Nov 21, 2021
@thinkerou thinkerou modified the milestones: v1.9, v1.10 Jan 17, 2023
@appleboy
Copy link
Member

Please fix the conflicts and move to 1.11

@appleboy appleboy modified the milestones: v1.10, v1.11 Mar 21, 2024
@guonaihong
Copy link
Contributor Author

Okay, I'll set aside time on Saturday to fix it.

@guonaihong
Copy link
Contributor Author

I might only have time to get this done on Monday evening

@appleboy
Copy link
Member

Please help to rebase the latest master branch. Thanks.

@guonaihong
Copy link
Contributor Author

Please help to rebase the latest master branch. Thanks.

ok

@appleboy
Copy link
Member

@guonaihong Can you close this PR and create a new PR? Since there is no CI/CD (testing and lint) checking in this PR.

@guonaihong
Copy link
Contributor Author

ok, I'll close this PR for now and open a new one on Monday.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants