> But your boss is not, and never will be, your friend.
I agree with the sentiment. I am still friends with people that were my direct reports many years ago. But, when I was their manager, I treat them fairly like any other employee. That they were my friends meant that we will hang after work hours. But, as I manager I could not be their friends in work hours. Favoritism will have been extremely unfair for the rest of employees, that still were very good people.
I also have friends that have been my managers. And, in the job I expected to be treated equally than the rest of employees. I guess that we are still friends because we think in a similar way about justice and work ethics.
With teammates has been different. I have been part of awesome teams that we have been friends while working together to later on drift apart as our interests outside the job does not match (quite usually people with children that have limited time to hang out).
The opposite of that are managers that "feel betrayed" when you leave a company that has been mistreating you, or tell you that they expect loyalty to the company that is not reciprocal. They are the "paterfamilias" of a dysfunctional and abusive family. There is nothing worse that a manager that expects to be treated as a friend, with loyalty and sacrifice but sees you as just a number.