package playne

imports "programmer"

Tag: golang

  • Writing to the Android Log

    So I just figured out how to get my log messages from a system Golang program into the android log without the need for logwrapper. It is a side effect of importing the “app” mobile package. so… import ( _ “golang.org/x/mobile/app” ) The downside is that *everything* written via stdout will go to the system…

  • How To: Cross compile Golang for Android

    Update 2022: Since this was back in the Golang 1.4 days and I have now had reason to do this again, the steps are a little easier. For Golang 1.19 I made a handy Makefile Here is a handy Makefile that will build a 32bit binary on an Ubuntu22.04 box

  • Cross Compile Golang on Ubuntu 14.04

    So today I needed to cross compile a basic Golang app from linux/amd64 to linux/arm (for android) on my Ubuntu 14.04 box. It is actually kinda easy sudo apt-get install golang-go-linux-arm because I am running the latest 1.3 golang i needed to run an extra step: cd /usr/local/go/src/ sudo GOARCH=arm ./make.bash Once you have that…

  • Golang – struct, make and the case of the missing variable

    I made a rookie mistake last night. I forgot an asterisk in my code and it caused me a an hour of confusion! TL;DR – methods on structs in golang need their stuct passed as a pointer if you want to modify it! This works func (f *Foo)SomeFunc() {} This does not! func (f Foo)SomeFunc()…