Hi dance... I'm so sorry to hear Franklin is having problems. I like the name you picked out, btw.
Surgery is a big leap anyway and certainly wouldn't be but a last resort, if it's even called for at all. Plus there's no way to tell if there's a tumor or the air bladder needing to be expanded or weighed down. Most of the time, this will clear itself -- the main thing you need to do is make the fish comfy and keep that water very clean. Most of the rest of what we do is wait.. some little things to give some relief. When a goldie is floating like this, it helps a lot to isolate him in a smaller QT tank. The shallow water makes it less stressful because he's not working so hard trying to move downward... yet not being able to. You should add salt to the water, as something of a tonic - one teaspoon per gallon, dissolved and added gradually. The peas you mentioned will help if this is related to an obstruction or constipation. But give the fish 2-3 days with no food at all. Fasting for a short time first helps reduce anything blocked inside. The fact that Franklin is still eating on his own is a positive sign, btw. Just give Franklin two weeks in a QT tank like this. Most of the time, they do all the recuperating themselves as long as we can make them comfortable and provide clean water conditions.
If he's bouyant enough that this dorsal fin and back stay above the water level, it will help to apply a little vaseline on the exposed area (once daily with a Q-tip or your finger) to keep that area from drying out.
In the meantime, let's see if we can figure out anything that may have caused or is contributing to this. What size is the tank Franklin is in? How many fish are there.. and what types? Tell us what your filtration is like. What are you feeding him/them and how often? Is the tank cycled? Do you use a liquid test kit to measure the water conditions.. and what are those results? How often do you do water changes? Do you condition the replacement water? (Lots of questions, I know.. but it gives us a better idea so we can offer more useful advice.) How long have you had Franklin and how long has this tank been set up? Have you noticed anything else unusual with your fish?
Will wait to hear back from you with a few more details. Let us know if anything changes. I really hope Franklin recovers quickly!