Skip to content
Myr

chore: update the result of CR (#2354)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

* chore: update the result of CR * Update utils.go * Update utils.go * Update context.go * Update context.go

authored by thinkerou · committed by GitHub · parent abc4fa0 · Browse files · 6 files+16 added−10 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

6 files+16 added−10 removed

  • other:+16 added−10 removed

6 files+16 added−10 removed

modified:auth.go+3 added-2 removed
68 unmodified lines
69 return BasicAuthForRealm(accounts, "")70}7172func processAccounts(accounts Accounts) authPairs {73 length := len(accounts)73 assert1(len(accounts) > 0, "Empty list of authorized credentials")74 pairs := make(authPairs, 0, len(accounts))74 assert1(length > 0, "Empty list of authorized credentials")75 pairs := make(authPairs, 0, length)76 for user, password := range accounts {77 assert1(user != "", "User can not be empty")78 value := authorizationHeader(user, password)79 pairs = append(pairs, authPair{
11 unmodified lines
modified:context.go+3 added-1 removed
32 unmodified lines
33 MIMEPlain = binding.MIMEPlain34 MIMEPOSTForm = binding.MIMEPOSTForm35 MIMEMultipartPOSTForm = binding.MIMEMultipartPOSTForm36 MIMEYAML = binding.MIMEYAML37 BodyBytesKey = "_gin-gonic/gin/bodybyteskey"37)3839// BodyBytesKey indicates a default body bytes key.40const BodyBytesKey = "_gin-gonic/gin/bodybyteskey"4142const abortIndex int8 = math.MaxInt8 / 24344// Context is the most important part of gin. It allows us to pass variables between middleware,45// manage the flow, validate the JSON of a request and render a JSON response for example.
1063 unmodified lines
modified:gin.go+4 added-3 removed
18 unmodified lines
1920const defaultMultipartMemory = 32 << 20 // 32 MB2122var (23 default404Body = []byte("404 page not found")24 default405Body = []byte("405 method not allowed")25 defaultAppEngine bool23 default404Body = []byte("404 page not found")24 default405Body = []byte("405 method not allowed")25)2627var defaultAppEngine bool2829// HandlerFunc defines the handler used by gin middleware as return value.30type HandlerFunc func(*Context)3132// HandlersChain defines a HandlerFunc array.
466 unmodified lines
modified:mode.go+1 added
20 unmodified lines
21 ReleaseMode = "release"22 // TestMode indicates gin mode is test.23 TestMode = "test"24)2526const (27 debugCode = iota28 releaseCode29 testCode
63 unmodified lines
modified:path.go+4 added-3 removed
134 unmodified lines
135 }136137 // Otherwise use either the stack buffer, if it is large enough, or138 // allocate a new buffer on the heap, and copy all previous characters.139 length := len(s)139 if l := len(s); l > cap(b) {140 *buf = make([]byte, len(s))140 if length > cap(b) {141 *buf = make([]byte, length)142 } else {142 *buf = (*buf)[:l]143 *buf = (*buf)[:length]144 }145 b = *buf146147 copy(b, s[:w])
3 unmodified lines
modified:recovery.go+1 added-1 removed
144 unmodified lines
145 return name146}147148func timeFormat(t time.Time) string {149 var timeString = t.Format("2006/01/02 - 15:04:05")149 timeString := t.Format("2006/01/02 - 15:04:05")150 return timeString151}