MCPcopy Index your code
hub / github.com/coder/coder / compressData

Function compressData

support/support.go:783–798  ·  view source on GitHub ↗
(data []byte)

Source from the content-addressed store, hash-verified

781}
782
783func compressData(data []byte) []byte {
784 if len(data) == 0 {
785 return data
786 }
787
788 var buf bytes.Buffer
789 gz := gzip.NewWriter(&buf)
790 if _, err := gz.Write(data); err != nil {
791 return data // Return uncompressed if compression fails
792 }
793 if err := gz.Close(); err != nil {
794 return data
795 }
796
797 return buf.Bytes()
798}
799
800// PprofInfoFromArchive uses the consolidated /api/v2/debug/profile endpoint
801// to collect pprof data in a single request. The server temporarily enables

Callers 3

PprofInfoFunction · 0.85
PprofInfoFromArchiveFunction · 0.85
PprofInfoFromAgentFunction · 0.85

Calls 3

WriteMethod · 0.65
CloseMethod · 0.65
BytesMethod · 0.45

Tested by

no test coverage detected