Golang : Problem in converting xml to gzip
问题 I am working on a program that compresses xml files to gzip using golang. but the program failed to generate files, however it does generate the output when I try to convert .txt file to gzip . Here is my program:- package main import ( "bytes" "compress/gzip" "fmt" "io" "log" "os" ) type Notes struct { To string `xml:"to"` From string `xml:"from"` Heading string `xml:"heading"` Body string `xml:"body"` } func main() { var buf bytes.Buffer zw := gzip.NewWriter(&buf) // Setting the Header