Bitbake / Yocto recipes for cross compiling golang program

For compiling simple golang helloworld program as part of yocto build framework, we need to download meta-golang from https://github.com/madisongh/meta-golang and use this meta layer along with poky to build our written bitbake recipes for cross compilation of golang program. PLEASE NOTE: Starting with OE-Core ‘rocko’ (Yocto Project 2.4), Go support is available directly in OE-Core, … Read more

How to use slices ( like dynamic array ) in go language ?

An array has a fixed size. A slice, on the other hand, is a dynamically-sized, flexible view into the elements of an array. In practice, slices are much more common than arrays. The type []T is a slice with elements of type T. A slice is formed by specifying two indices, a low and high … Read more

Arrays in Go language with Simple example

The below program initialises a static array of 7 elements and prints the values of each element using for loop, this this program demonstrates how to initialise a static array and also how to use a for loop in go language. As we can see above, array can be declared an initialised in go as, … Read more

How to execute C code from go – c to golang binding

package main // If a Go source file imports “C”, it is using cgo. The Go file will have access to anything appearing in the comment immediately preceding the line import “C”, and will be linked against all other cgo comments in other Go files, and all C files included in the build process. /* … Read more

How to resolve error : ” no buildable Go source files in “

Sometimes when we try to compile an unknown go package, we can see an error like “no buildable Go source files in”, the possible solution could be, Subscribe with Valid Email Id to receive updates in Inbox. ( Secured by Google FeedBurner )     Check if the package which shows error “no buildable Go … Read more