mirror of
https://gitee.com/johng/gf
synced 2026-06-07 02:12:11 +08:00
improve gzip feature for gcompress; add gzip compression for package gres
This commit is contained in:
@ -2,12 +2,23 @@ package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/gogf/gf/frame/g"
|
||||
"github.com/gogf/gf/os/gres"
|
||||
)
|
||||
|
||||
func main() {
|
||||
result, _ := g.View().ParseContent("姓名: ${.name}", g.Map{
|
||||
"name": "<script>alert('john');</script>",
|
||||
})
|
||||
fmt.Println(result)
|
||||
//buffer := bytes.NewBuffer(nil)
|
||||
//buffer.WriteString("\x00")
|
||||
//hex.Decode()
|
||||
//if v, e := strconv.ParseInt(s[2:], 16, 64); e == nil {
|
||||
// return v
|
||||
//}
|
||||
//s := "\x00"
|
||||
//fmt.Println([]byte(s))
|
||||
//return
|
||||
err := gres.PackToGoFile(
|
||||
"/Users/john/Workspace/Go/GOPATH/src/github.com/gogf/gf-cli/public",
|
||||
"/Users/john/Workspace/Go/GOPATH/src/github.com/gogf/gf/.example/other/config.go",
|
||||
"main",
|
||||
)
|
||||
fmt.Println(err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user