The solution is to either update some part of the draw2d library to no longer require the type assertion, or to assume everything passed to the functions is a *draw2dgl.GraphicContext struct instead of draw2d.GraphicContext interface (which we already assume the underlying struct is *draw2dgl.GraphicContext anyways).