I'm not familiar with Swift but the Go code returns a zlib (RFC 1950) compressed string while according to the documentation from Apple the Swift code should at most return a deflate compressed string (RFC 1951), i.e. like the zlib compressed but without the 2 byte zlib header.
With that knowledge the string returned from the Go code can be properly decompressed while the string returned from Swift can not. The difference in size is also obvious which lets me assume that something was cut off. It looks like you treat the compressed data
destinationBuffer as a
cString, which means that any
\0-byte inside the string will be treated as the end of the string. It is likely that such
\0 byte exists as the result of compression and that the string got cut off there, i.e. that your output shows only part of the real
destinationBuffer. (EDIT: the last part does not apply anymore since the OP changed the question with a proper result).