(archivePath string)
| 112 | } |
| 113 | |
| 114 | func toGzip(archivePath string) errors.Error { |
| 115 | info, _ := os.Stat(archivePath) |
| 116 | b, err := os.ReadFile(archivePath) |
| 117 | if err != nil { |
| 118 | return errors.Convert(err) |
| 119 | } |
| 120 | var buf bytes.Buffer |
| 121 | w := gzip.NewWriter(&buf) |
| 122 | _, err = w.Write(b) |
| 123 | _ = w.Close() |
| 124 | if err != nil { |
| 125 | return errors.Convert(err) |
| 126 | } |
| 127 | return errors.Convert(os.WriteFile(archivePath, buf.Bytes(), info.Mode().Perm())) |
| 128 | } |
no test coverage detected