As discussed here it is possible for Java jar files (zip formatted archives) to include a prefixed bash script that allows them to act like fully executable applications. Many existing tools (java -jar, unzip etc) support zip files with additional prefixed bytes.
Unfortunately go currently doesn't support the reading of such archives which causes problems for the Cloud Foundry cli tool.