improve gzip feature for gcompress; add gzip compression for package gres

This commit is contained in:
John
2020-01-15 00:15:56 +08:00
parent 22af5be71f
commit edf2366296
13 changed files with 177 additions and 121 deletions

View File

@ -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)
}