I'm a noob to box2d (and Go), I was following a C++ example on creating joints.
In the example:
b2xxxJoint* joint = (b2xxxJoint*)world->CreateJoint( &jointDef );
They cast the returned joint to the one they wanted created. Doing the same in Go gives a compilation error
impossible type assertion:
box2d.B2FrictionJoint does not implement box2d.B2JointInterface (Dump method has pointer receiver)
var jointDef box2d.B2FrictionJointDef = box2d.MakeB2FrictionJointDef()
jointDef.BodyA = ball1
jointDef.BodyB = ball2
joint := world.CreateJoint(&jointDef).(box2d.B2FrictionJoint)
Looking at the source and you can see it's a pointer receiver B2JointFrictio Line 282
Some of the other joints are not B2JointDistance Line 337