This repository has been archived by the owner on Dec 23, 2023. It is now read-only.
Context enhancement #27
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Closed
Closed
和新增的 JSON HTML ... 方法风格统一,状态码在前. 当前: Line 46 in c39b5cc
ctx.Redirect("https://www.google.com/", 302)
return nil 修改后: func (ctx *Context) Redirect(code int, url string) error { return ctx.Redirect(302, "https://www.google.com/") 能少写一行. |
我觉得现有的接口尽量保持原样,不作改动,以避免打破向后兼容性。另外 Redirect 使用频率应该很低,对编码影响不大。 |
beikege
reviewed
Apr 3, 2020
@beikege 基本完成了,可以 review 或补充一下。 另外已经添加了 Jet Renderer 的实现,至于其他模板引擎,由于没有太多的了解和使用经验,就不一一实现了。 |
beikege
reviewed
Apr 3, 2020
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Context.SetCookie
: already done since v1.6Context.Cookies
andContext.Cookie
Context.Emit
,Context.Blob
Context.JSON
,Context.JSONBlob
Context.JSONP
,Context.JSONPCallback
,Context.JSONPBlob
,Context.JSONPCallbackBlob
Context.XML
,Context.XMLBlob
Context.String
Context.HTML
,Context.HTMLBlob
Context.FormValue
Context.PostFormValue
Context.QueryString
,Context.QueryParams
andContext.QueryParam
Context.Render
: renders a template. Renderer implementation:Context.RouteURL
: generates the URL of naming route.