code: func DetectCompression(source []byte) Compression {
  	for compression, m := range map[Compression][]byte{
  		Bzip2: {0x42, 0x5A, 0x68},
  		Gzip:  {0x1F, 0x8B, 0x08},
  		Xz:    {0xFD, 0x37, 0x7A, 0x58, 0x5A, 0x00},
  	} {
  		if len(source) < len(m) {
  			logrus.Debug("Len too short")
  			continue
  		}
  		if bytes.Equal(m, source[:len(m)]) {
  			return compression
  		}
  	}
  	return Uncompressed
  }
docs: // DetectCompression detects the compression algorithm of the source.