View ReaderFunc.go
This programs generates 32 random bytes formatted à la "hexdump -C".
It does it in just 2 lines of code using the power of the standard library
and a trick to convert a func Read([]byte) (int, error) into an io.Reader.
Inspiration: see HandlerFunc in net/http

gomvfile design draft

This is a design draft for a tool (gomvfile) that would allow to migrate a set of symbols from a package to another.

Strategy for symbols migration

  1. Isolate symbols that have to move: move all symbols to migrate into one or multiple separate source files. Those sources must not have depenencies on the internals (private symbols, private struct members) of the rest of the package.
  2. Use gomvfile to migrate the files to the target package


# Copyright (c) 2016 Olivier Mengué
# License: Apache 2.0
# The connection settings to use are based on the filename of this script
suffix="$(basename "$0" .sh)"
# Connection through SSH
if [[ "_${suffix:0:9}" = _mysql+ssh ]]; then
f=$(mktemp -t XXXXXXXX.go); sed -n '3,$p' "$0" >"$f"; go run "$f"; e=$?; rm -f "$f"; exit $?
package main
import "fmt"
func main() {
# Equivalents of C++ 2016 "if statement with initializer", in Perl 5
if ((my $p = $m->try_emplace($key, $value)), !$p->second) {
FATAL("Element already registered")
} else {
package strict_subs;
use strict;
use warnings;
use Sub::StrictDecl;
sub DB{}
sub import
#!/usr/bin/env perl
use 5.010;
use strict;
use warnings;
my %map = (
0 => 0x000000,
1 => 0x800000,
2 => 0x008000,
3 => 0x808000,
View .bashrc
alias minicpan='minicpan -c CPAN::Mini::LatestDistVersion&&cpandb --setup&&perl -MCPAN -e "CPAN::Index->force_reload"'
alias cpan-outdated="cpan-outdated --index 'file://$(sed -n 's/^local: *//p' ~/.minicpanrc)modules/02packages.details.txt.gz'"
go test -coverprofile=.coverage.out && exec go tool cover -html=.coverage.out