In the (mongo.Client).Ping(context.Context, *readpref.ReadPref) method, it looks like the ReadPref argument isn't actually used. The Client 's readpref is also not used as the default when running the command. Instead, it seems that on this line, the read preference defaults to primary.
Ping should use the argued read preference if it is non-nil, and should use c.readPreference if the argument is nil. This should be easily fixed by adding options.RunCmd().SetReadPreference(rp) to this method call.