Category: Go

  • Golang Challenge 2 comments

    by

    in

    I’ve just finished evaluating 40 of the 105 entries to the Golang Challenge #2. The organizer, Satish, asked me to write up my thoughts. The main similarity I noticed in the entries was not enough testing. The vast majority of the entries used the tests provided in with the challenge unmodified. Taking the given tests…

  • Go Challenge 2 is live!

    by

    in

    The Go Challenge for April is now live! As an evaluator, I’ve already solved it. It was fun, and just the right size. Go try it, you’ll have fun!

  • Building Go 1.4 when the linker doesn’t know about build-id

    by

    in ,

    Today at work, on a Redhat 5.5 machine, I tried to build Go 1.4. This happened: $ cd go1.4/src $ ./all.bash …snip… # runtime/cgo /usr/bin/ld: unrecognized option ‘–build-id=none’ /usr/bin/ld: use the –help option for usage information collect2: ld returned 1 exit status The solution is to retry without the “–build-id=none” option: diff –git a/src/cmd/go/build.go b/src/cmd/go/build.go…

  • Go will make you a better programmer

    by

    in

    The last line of Dave Cheny’s Gophercon 2015 India keynote is the best: “Go will make you a better programmer.” It’s true. When I am programming Go, I never think, “OK, is this an OK shortcut to take here? Is this a play context? Is this a work context, but I can push off bounds…

  • A Quick Go hack: lines-per-second

    by

    in

    Today I wanted to compare how fast two builds were on two different machines. As a rough estimate, I just wanted to see how many lines per second were going into the log file. This is what I came up with: package main import ( “bufio” “fmt” “os” “time” ) func main() { scn :=…

  • Golang on the Geode processor

    by

    in

    If you are trying to use Golang on a PC-Engines Alix board, you need to be careful that all the Go code you are using is compiled while the GO386 environment variable is set to 387. The Geode processor does not support the SSE instructions. If you have Linux directly on the Alix, you’d not…

  • Type safety saves the day again

    by

    in

    Recently, I was writing some code to check the SHA256 of a buffer. Simple, right? All you have to do is take the hash you have, get the hash of the data, and compare them. But then you think, “oh, what a drag, I gotta compare two []byte values for equality, and == doesn’t work…

  • Moonrise

    by

    in ,

    My time-lapse camera in the attic is still working, though I resorted to adding an auto reboot once a week, because the Raspberry Pi is not acting too stable. And even then, sometimes it hangs. I blame the power supply. Because it’s always the power supply, right? Anyway watching the sun’s track northward as spring…

  • Live from Mont-la-ville

    by

    in ,

    The last few days I’ve been working on a new home hacking project. The eventual plan is to create a panoramic time-lapse of sunrise as seen from my house each morning. We’ve got a wonderful view, and recording some of those beautiful morning colors as the sun comes up over the Alps should make them…