golang读取http响应的gz package


func main() {
    resp, _ := HTTPRequest("GET", "http://some-gz-package/package-name", nil)
    defer resp.Body.Close()

    gz, err := gzip.NewReader(resp.Body)
    if err != nil {
        fmt.Println(err.Error())
        return
    }
    defer gz.Close()
    scanner := bufio.NewScanner(gz)
    for scanner.Scan() {
        fmt.Println(scanner.Text())
    }
}

There are comments.