liked Sheffield’s Twin Towers at

read The Penguin Book of Japanese Short Stories

5 years later, a new way to test in Go

5 years ago I forked https://github.com/stretchr/testify, because I wanted to "fix" the ordering of arguments to some of the functions. It isn't something that really matters, as I've lived with it for 5 years and it is one of the more popular assertion packages.

But last week I started thinking about it again, and decided that maybe I should do something about:


assert.Equal(t, expected, actual)
assert.Len(t, actualList, expectedLength)

As I'd already published the package, by virtue of having my fork on GitHub, I didn't want to change the existing API. I doubt anyone else relied on it, and with modules it shouldn't affect me, but I am trying to do things at least semi-properly.

So I added a new API. The new style is impossible to get wrong. The only cost is that you have to get the assertion function by wrapping the *testing.T first (you don't have to, but it would be ugly not to).

assert := assert.Wrap(t)

assert(actual).Equal(expected)
assert(actualList).Len(expectedLength)

I haven't changed the naming so some of them may read a bit weird.

When I originally forked the repo I did do one thing: I moved the assert package to be the root. I never really liked the style of test where the first failing assertion quits the test. It just means you have to run a test over and over to find all of the problems. But sometimes it is useful if one assertion means the others are pointless; for instance, if a list is empty you don't need to assert properties on the first element.

With the new API I have been able to provide the ability to do both. Using the .Must property on the wrapped assertion function gives access to the same API but with the methods will terminate the current test.

assert := assert.Wrap(t)

assert(actual).Must.Equal(expected)
assert(actualList).Must.Len(expectedLength)

Admittedly the naming does get even more off with the word "Must" in the middle, but this is Go not English…

Anyway a 5 year long task, done.

liked Keiss Castle, Caithness at < a crowd of bicycles > at

I will never understand why Firefox's default tabbing behaviour is set to "show me an alt-tab thing with my tabs in an order I don't expect"

liked Crank.js | Introducting Crank at

liked @CjvHenderson's tweet at @iyad_elbaghdadi's tweet at

liked @mjohnharrison's tweet at Coil Radio w/ Murlo 7th November 2018 at

liked Sodade De Um Paraíso Distante w/ Paco Alborghetti 5th April 2020 at

liked hawx/tally-ho at

Flickr's username problems

I feel like I'm missing something. Say I have a URL for someone's Flickr profile (e.g. https://www.flickr.com/people/hawx-/), and I want to retrieve the info for that user using the API, what method should I call?

flickr.people.getInfo will get the data I want, but it needs the NSID of the person. Now you can have URLs like https://www.flickr.com/people/75695140@N04, which is my profile again, but it is much nicer to refer to them using the "nice URL".

I can get the NSID using flickr.people.findByUsername, but this wants the username which may not be the same as the thing in the URL. In my case I have "hawx-" in the URL, but my username is "hawx~".

Light Mode

When I started building this site I wanted to bring back the feel of my old Tumblr. Not that I really posted that much there, or here, but the mix of content was nice and something I missed on /weblog.

I liked the colour palette which I had found on colourlovers.com however many years ago. If I pick colours myself it always ends up being a standard white/black/accent website, which is 98% of the web and therefore boring. I also loved the way Signika Negative looked, so wanted to bring that too.

But it is 2020 and everyone is adding dark modes, so what do you do when your site is already dark?

@media (prefers-color-scheme: light)

of course

liked Link Cowboys at

flatten the curve, but agile
Does flatten the curve also explain lean?

liked @Kyle_MacLachlan's tweet at

replied to @firagabeatsrock's tweet

Adam Witko :

@hawx You need to get yourself some flour laddy!
That is a textbook loaf, but there is no need to show off how much flour you have by sprinkling additional flour on top.

replied to @firagabeatsrock's tweet

Adam Witko :

@hawx How lavish is your lockdown!?
This is it. This is the peak of my lockdown life. Though I think it is more lavish that I'm buying fresh bread every other day because it is the only source of carbs I can consistently find.

liked @somebadideas's tweet at @paxthedog's tweet at

The Kraft Werks beer run is improving lockdown. https://shop.kraft-werks.com/collections/ipa-dipa/products/blowout is top notch
Calling Seinfeld a show about nothing seems a bit of a stretch now that we're in a lockdown.
Government: "stay at home" / TV News: "now to join our reporters around the country"