Caught off guard: Should you declare more than one “class” within a single file (for Go)?

Weiyuan
8 min readFeb 4, 2021
Original image — source: pixabay, author: LukasBasel

“Why do we declare more than one “class” in a single .go file?”

“That is a very interesting question”, I thought to myself. As I scrambled to find an answer to this very intriguing question, a phrase appeared up in my mind — Go packages.

--

--

Weiyuan

Senior Engineering Manager, Ascenda Loyalty | Former Engineering Manager, Grab | Former Director of Engineering, ZilLearn | bit.ly/weiyuan