To steal a quote from JWZ, Some people, when confronted with a problem, think “I know, I’ll use cgo.” Now they have two problems. Recently the use of cgo came up on the Gophers’ slack channel and I voiced my concerns that using cgo, especially on a project that is intended to showcase Go inside […]
#cgo
4 posts
18 Jan 2016
28 Mar 2014
This is a quick post to discuss the rules of comments in Go. To quickly recap, Go comments come in two forms // everything from the double slash to the end of line is a comment /* everything from the opening slash star, to the closing one is a comment */ As the first form […]
7 Sept 2013
It looks like Go 1.4 will remove support for Go packages containing C code (as described below, don’t confuse this with CGO), so enjoy it while it lasts. This is a short post designed to illustrate how Go package authors can write package level functions in C and call them from Go code without using […]
8 Jul 2013
This post is a compliment to one I wrote in August of last year, updating it for Go 1.1. Since last year tools such as goxc have appeared which go a beyond a simple shell wrapper to provide a complete build and distribution solution. Introduction Go provides excellent support for producing binaries for foreign platforms […]