Skip to content
This repository has been archived by the owner on Nov 15, 2022. It is now read-only.

Commit

Permalink
docs: define go import convention
Browse files Browse the repository at this point in the history
Add a developer doc that explains how to arrange imports so that
when new imports are added, unnecessary changes in import space
are avoided.
  • Loading branch information
surajssd committed Sep 13, 2017
1 parent cfee15f commit e28cd22
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions docs/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -206,3 +206,30 @@ please add a ref tag comment:
please refer to the swagger specification of Kubernetes for any particular release. For e.g
In Kubernetes 1.7, the reference tag for deployment is
`io.k8s.kubernetes.pkg.apis.apps.v1beta1.DeploymentSpec`.

### golang dependency import conventions

imports MUST be arranged in three sections, separated by empty line.

```go
stdlib
kedge
thirdparty
```

for e.g.

```go
"fmt"
"io"
"os/exec"

pkgcmd "github.com/kedgeproject/kedge/pkg/cmd"
"github.com/kedgeproject/kedge/pkg/spec"

"github.com/ghodss/yaml"
"github.com/pkg/errors"
```

And once arranged in such sections let go tooling take care of sorting the
sequence of imports for you.

0 comments on commit e28cd22

Please sign in to comment.