Statically Asserting Go Interface Implementations

Today I learnt about the practice of statically asserting that a type in Go implements an interface. This is for cases where you want to guarantee a given type implements an interface, but you’re not in a position to assert this yourself within your own code.

An example of this might be to demonstrate a given type implements json.Marshaller. You’re generally not going to…