Commit Graph

9 Commits (d4834071da9ce010fd4677ef339c598dd23dc130)

Author SHA1 Message Date
wxiaoguang 65f17bfc31
Refactor legacy `unknwon/com` package, improve golangci lint ()
The main purpose is to refactor the legacy `unknwon/com` package.
1. Remove most imports of `unknwon/com`, only `util/legacy.go` imports the legacy `unknwon/com`
2. Use golangci's depguard to process denied packages
3. Fix some incorrect values in golangci.yml, eg, the version should be quoted string `"1.18"`
4. Use correctly escaped content for `go-import` and `go-source` meta tags
5. Refactor `com.Expand` to our stable (and the same fast) `vars.Expand`, our `vars.Expand` can still return partially rendered content even if the template is not good (eg: key mistach).
KN4CK3R 3f280f89e7
Update HTTP status codes to modern codes ()
* 2xx/3xx/4xx/5xx -> http.Status...
* http.StatusFound -> http.StatusTemporaryRedirect
* http.StatusMovedPermanently -> http.StatusPermanentRedirect
wxiaoguang 4da1d97810
Refactor HTTP request context ()
Lunny Xiao 719bddcd76
Move repository model into models/repo ()
* Some refactors related repository model

* Move more methods out of repository

* Move repository into models/repo

* Fix test

* Fix test

* some improvements

* Remove unnecessary function
wxiaoguang 750a8465f5
A better go code formatter, and now `make fmt` can run in Windows ()
* go build / format tools
* re-format imports
6543 f1a810e090
Related refactors to ctx.FormX functions ()
* use FormTrim if posible

* speedup goGet

* only convert if nessesary
6543 c4d70a0325
Rename ctx.Form() to ctx.FormString() and move code into own file ()
Followup from  prepare for 

* Rename ctx.Form() to ctx.FormString()
* Reimplement FormX func to need less code and cpu cycles
* Move code into own file
Lunny Xiao 33e0b38287
Rename context.Query to context.Form ()
Lunny Xiao 1bfb0a24d8
Refactor routers directory ()
* refactor routers directory

* move func used for web and api to common

* make corsHandler a function to prohibit side efects

* rm unused func

Co-authored-by: 6543 <6543@obermui.de>