Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gin1.5 bytes.Buffer to strings.Builder #1939

Merged
merged 4 commits into from
Jun 29, 2019

Conversation

guonaihong
Copy link
Contributor

@guonaihong guonaihong commented Jun 10, 2019

Go1.10's strings.Builder structure saves memory
This is its implementation principle

// String returns the accumulated string.
func (b *Builder) String() string {
    return *(*string)(unsafe.Pointer(&b.buf))
}

@guonaihong guonaihong changed the title Gin1.5 bytes to builder Gin1.5 bytes.Buffer to strings.Builder Jun 10, 2019
@thinkerou
Copy link
Member

waiting #1933 merged.

@guonaihong
Copy link
Contributor Author

ok

errors.go Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Jun 29, 2019

Codecov Report

Merging #1939 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1939   +/-   ##
=======================================
  Coverage   98.69%   98.69%           
=======================================
  Files          40       40           
  Lines        2218     2218           
=======================================
  Hits         2189     2189           
  Misses         16       16           
  Partials       13       13
Impacted Files Coverage Δ
errors.go 100% <100%> (ø) ⬆️
debug.go 96% <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 3f53a58...5f4949c. Read the comment docs.

@thinkerou thinkerou added this to the 1.5 milestone Jun 29, 2019
@thinkerou thinkerou merged commit b67bc8f into gin-gonic:master Jun 29, 2019
ThomasObenaus pushed a commit to ThomasObenaus/gin that referenced this pull request Feb 19, 2020
* Replace bytes.Buffer to strings.Builder

* Merge the latest changes

* Update errors.go
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants