Easily convert .jpg and .png to .icns with the command line tool icnsify, or use the library to convert from any image.Image to .icns.
go get github.com/jackmordaunt/icns
icns files allow for high resolution icons to make your apps look sexy. The most common ways to generate icns files are:
iconutil, which is a Mac native cli utility.
ImageMagick which adds a large dependency to your project for such a simple use case.
With this library you can use pure Go to create icns files from any source image, given that you can decode it into an image.Image, without any heavyweight dependencies or subprocessing required. You can also use it to create icns files on windows and linux (thanks Go).
A small CLI app icnsify is provided allowing you to create icns files using this library from the command line. It supports piping, which is something iconutil does not do, making it substantially easier to wrap or chuck into a shell pipeline.
Note: All icons within the icns are sized for high dpi retina screens, using the appropriate icns OSTypes.