Skip to content
This repository has been archived by the owner on May 21, 2024. It is now read-only.

Commit

Permalink
Added code style rule for outdated code
Browse files Browse the repository at this point in the history
  • Loading branch information
akyoto committed Sep 27, 2018
1 parent b13572e commit 494d219
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions docs/code-style.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ This document is only meant to teach you the code style used in this project and
* [Variable names](#variable-names)
* [Types at the top](#types-at-the-top)
* [Private fields at the end of a struct](#private-fields-at-the-end-of-a-struct)
* [Don't comment out outdated code](#dont-comment-out-outdated-code)
* [Package names](#package-names)
* [Use gofmt](#use-gofmt)
* [Code editor](#code-editor)
Expand Down Expand Up @@ -151,6 +152,10 @@ type MyType struct {
}
```

## Don't comment out outdated code

You should delete outdated code instead of commenting it out. Comments should be used for explanation of existing code and outdated code is saved in the git history anyway if you ever need it (in most cases outdated code is never re-used).

## Package names

Package names should be short lowercase identifiers and tests should be written using the black box pattern. Black box testing can be enabled by adding the suffix `_test` to the package names in `*_test.go` files. It will enable you to test your library like it would be used by another developer, without internal access to private variables.
Expand Down

0 comments on commit 494d219

Please sign in to comment.