errors

Runtime errors are a bit different in Go compared to other languages. Go lacks the familiar error handling like try/catch. Gophers think about errors a bit differently. In Go errors are values like any other kind of type in go. Because of this we often see signatures that are like func DoSomething() error or func FetchSomething() (results, error) And our functions tend to be composed of a lot of if err !
Read more →

Hitchhiker’s Guide To Context

If you’re new to Go you might have seen some functions like func Foo(ctx context.Context) error Context is a pattern frequently used in systems programming to help manage the life cycle of complex systems. We see often in Go as its considered good practice, is part of the standard library, and is extremely useful. In go we have context.Context which is an interface like 1 type Context interface { Deadline() (deadline time.
Read more →

injection with closures

In languages that have first class functions we can define closures that lexically capture values in the scope that they are defined in. package main import "fmt" func main() { b := true closure := func() error { err := fmt.Errorf("something bad happened!!") if b { return err } return nil } b = false err := closure() fmt.Printf("%v\n", err) } In this example we lexically capture b in our closure.
Read more →

service desks

don’t use service desks as a means of collaboration inside of an organization. Service, or Help Desks are a system that have been in use since the beginning of the internet. We often see companies that deliver software to large user bases have a help desk that is ran by a support team. This brings the company numerous benefits including: Cost effective support for confused consumers. Better understanding of the software to its consumers.
Read more →

PTWFL

Recently at work I’ve been helping to onboard a few new folks. When they run into a technical issue and they ask for help, it is often the case they aren’t aware of what the actual problem is. They will often ask about something else entirely that actually isn’t the problem that they ran into.1 I often find myself saying something along the lines of can you post the whole log?
Read more →

struct-to-map

Occasionally in go we want convert our structured data into an unstructured format, such as a map[string]interface{} for struct like: type Foo struct { A Bar `json:"a"` B Bar `json:"b"` C Bar `json:"c"` D Bar `json:"d"` E Bar `json:"e"` F int `json:"f"` G uint `json:"g"` H string `json:"h"` } type Bar struct { Bar string `json:"bar"` } There are a couple ways we can convert it into a map. manually func base(foo Foo) map[string]interface{} { result := make(map[string]interface{}) result["A"] = foo.
Read more →

reddit

is a link aggregator and thats all it should be. Through a system of anonymity and fake internet points reddit brings attention to things that people generally find interesting or important around a particular topic. It’s not a discussion board. If you debate people on reddit you look naive. You are trying to convince a random person behind a keyboard of a particular viewpoint. You have no idea who that person is.
Read more →

retro-gaming-devices

I loved playing pokemon games as kid. Problem is that I still love playing them. I’ve played pokemon games on emulators at my PC, but sitting at computer after I just sat there all day for my job doesn’t really capture the joys of my childhood. So I’ve started to trying to find a handheld device that will let me re-experience the glory days of the game boy and the Nintendo DS.
Read more →

dual-booting

This is a guide to a bare metal dual boot of Windows 10 and Ubuntu. No emulation, or virtualization. Most of this guide comes from my personal experiance over several years of having a dual boot install, any pain points that I highlight are because I have experianced them myself. Obiviously, this is not a complete resource of all the information you might need to do this, but this post does have all the information you mighy need.
Read more →