Functions
Keep Functions Small
Keep functions small, focused on one thing. If you have six separate tasks being performed by a function, create six functions for these.
Group Functions Logically
Try to always separate unexported and exported functions in groups, with the exported ones first, unless it helps readability and code discovery.