From 71d204ab1c72b9d2f4d0265907e60475cc30545b Mon Sep 17 00:00:00 2001 From: Abhinav Gupta Date: Mon, 17 Dec 2018 07:49:51 -0800 Subject: [PATCH] CONTRIBUTING: Add import group conventions As discussed in #20, this adds import grouping recommendations to the coding conventions section of CONTRIBUTING.md. Note that I replaced `go fmt` with `goimports` because `goimports` implements a superset of the `go fmt` functionality. --- .github/CONTRIBUTING.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 8c14a19..997f669 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -22,11 +22,20 @@ Please follow our coding conventions below and make sure all of your commits are We strive for consistency above all. Reading the small codebase should give you a good idea of the conventions we follow. -* We use `go fmt` before committing anything +* We use `goimports` before committing anything * We aim to document all exported entities * Go files are broken up into logical functional components * General functions are extracted into modules when possible +### Import Groups + +We aim for two import groups: + +* Standard library imports +* Everything else + +`goimports` already does this for you along with running `go fmt`. + ## Design conventions We maintain a few high-level design principles in all decisions we make. Keep these in mind while devising new functionality: