Latest sites

Quick news

  • 2014-03-27: MongoDB Watchdog module ported to Drupal 8 at the Szeged Dev Days.
  • 2014-01-26: My post on the Symfony web profiler in Silex selected in Week of Symfony. w00t !
  • 2013-10-18: My first commit went into MongoDB today. And, guess what ? It's in JavaScript
  • 2013-09-20 to 29: Working on Drupal 8 EntityAPI at the extended code sprints during and around DrupalCon Prague
  • 2012-08-19: Working on Drupal 8 EntityAPI at Drupalcon Munich
  • 2012-06-15: Working on Drupal 8 EntityAPI at DrupalDevDays Barcelona
  • 2012-03-23: Working on the future Drupal Document Oriented Storage at DrupalCon Denver. D8 or later ? Bets are on Later

Google Go = Golang

The Google Go language.

Golang tip of the day; PHP-compatible crc32

While porting (well, actually rewriting) an old PHP library to Go, I had to use a CRC (cyclic redundancy check) on a buffer. In old-school PHP, the standard is well established since PHP 4: just use crc32 from the strings package, and beware of the sign bit or, to be a bit more current while still compatible, use the hash() function from the hash package, like this example:

Go tip of the day : running tests for all subpackages recursively

If you program in Go, you've probably written a lot of packages, and probably split packages in subpackages. Maybe even more than idiomatic Go would really advise... And you may have been grumbling just like I did at the fact that the go test command requires a list of packages, and does not recursively dive into all the subpackages, like PHPunit would, and does not seem to have a working recursion flag.

Calling methods on null objects in Go and PHP

Call a method on a nil pointer (null object) ? This is a classical bug. What if it somehow turned out to be a valid and useful construct in some languages, say in Go ? And what about PHP ?

Golang fun : adding methods to primitive types

Go syntax has some funny peculiarities which are not immediately obvious, like methods on primitive types. Let's have a look.

Primitive wrapper types

Anyone with a few hours of Go is familiar with the basic object notation, like this example:

Golang tip of the day: admin dashboard and health checks in Beego applications

One litle-publicized feature of the BeeGo Go framework is its admin dashboard.


Although it may look quite raw visually (think MIME: text/plain), it contains a wealth of information about goroutines, threads, memory usage, and request statistics. It even allows devs to add to a "healthcheck" list, and admins allowed dashboard access to run "tasks" defined in code. The diagram belows shows the hierarchy of features in the version coming with Beego 1.3.0.

What to do when Go will not run, nor install from source ?

Some days ago, at the AWS Summit 2014, DamZ renewed my long-sleeping interest for the Google Go language with wonderous stories about its use in infrastructure of the new Commerce Guys Platform they were launching that same days, so I've been doing my homework getting up to date on Go programming: that's what holidays are for, aren't they ?

Syndicate content