After almost one year with an Apple Silicon macBook, I eventually got my first actual problem caused by the architecture : trying to deploy the Flagr Open Source feature flags service, the docker deployment failed like with an image error. The fix turned out to be fairly simple:
Google Go = Golang
The Google Go language.
La gestion des erreurs en Go 1.14 ne se limite plus à l'interface error: découvrez l'ensemble des mécanismes disponibles.
Découvrez les statistiques de l'interface error, et les tentatives qui ont abouti aux nouvelles fonctions du paquet
Is et le nouveau format
The "Go internals unofficial wiki" on goin.wikispot.org used to be a valuable resource for developers interesting in the internal operation of the Go runtime, but disappeared when wikispot.org went down in 04/2014.
I spent a couple of hours this morning to restore and reformat its contents to the Golang section on the Audean wiki.
Enjoy... but responsibly : its content was fresh in 2014, not last week...
When GoLand is upgraded from one version to the next, the deployment process adds a new set of configuration, cache, and log directories. But it does not remove the versions associated to the previous versions of the IDE, to ease rolling back to the previous version if an upgrade happens to cause an issue.
So after some time, removing these now-unused folders will regain some disk space, possibly more than 1 GB. Here are their respective locations and content on macOS:
The problemIn a GoLand 2018.3 EAP run configuration, a Makefile run configuration finds the
gobinary on macOS, but not on Ubuntu, causing make targets like this one to fail:
# Building WASM
GOARCH=wasm GOOS=js go build -o client/test.wasm client/main.go
/usr/bin/make -f (some edited path)/Makefile client/test.wasm
/bin/sh: 1: go: not found
make: *** [client/test.wasm] Error 127
Simple enough to fix...
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:
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.
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 ?
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: