Unmarshalling to structs in Go - no brainer, eh?

Those days I ran into the same trap the second time. So I decided to have a short writeup for future me and other Go beginners. The trap was that I wrote nice structs like { "key1": "value1", "key2": "value2" } And wanted them to be unmarshalled them into structs like this: type foo struct { key1 string key2 string } Doing this regularly with Jackson in Java I named the attributes like the keys in the JSON file. …

Posted on

contact

My email address is myfirstname@jayasinghe.de You can also find me on Mastodon: https://chaos.social/web/@rjayasinghe I write a lot of code. The code that is either written in my spare time or that is allowed to be published can be found at my Github page Some of my bike trips can be seen at Komoot

Posted on

about

This is my private website. I am not sure yet what I’ll publish here. Mostly it will be nerdy stuff about bicycles and computers. :) The site has been built with the static site generator Hugo and is hosted at Netlify. If you have ever felt the desire to migrate away from wordpress and do something more lightweight - get in touch with me. ;) yes. that's me. ;)

Posted on

imprint

This is a private website. No commercial intent or whatever. If you don’t like it - go away! :-D

Posted on

Transalp 2010

Die Idee entstand im Frühjahr 2010 beim Mittagessen in der Firma. Boris und ich waren der Meinung, dass man(n) eigentlich mal über die Alpen geradelt sein sollte. Das Vorhaben klang für mich erst mal total abstrus, aber es haben ja auch schon andere geschafft. Warum also nicht? :) Nach einiger Recherche im Internet haben wir uns bei unserer ersten Tour dieser Art für die alte Römerstraße Viamala sowie für den Splügenpass entschieden. …

Posted on