Skip to content

v0.0.4版本

Compare
Choose a tag to compare
@guonaihong guonaihong released this 21 Jul 10:54
· 4 commits to master since this release

上传进度条功能

package main

import (
        "bytes"
        "github.com/antlabs/gout-middleware/request"
        "github.com/guonaihong/gout"
)

func main() {
        gout.POST(":8080").RequestUse(request.ProgressBar(func(currBytes, totalBytes int) {

                fmt.Printf("%d:%d-->%f%%\n", currBytes, totalBytes, float64(currBytes)/float64(totalBytes))
        })).SetBody(strings.Repeat("1", 100000) /*构造大点的测试数据,这里换成真实业务数据*/).Do()
}