Skip to content

Coding standards

kstola2 edited this page Jun 25, 2019 · 5 revisions

Syntax

We use camel-case for variable and function names.

Errors

Returning custom errors from your functions is a way of identifying the root of undesired behavior. If there is a case in your function that checks for errors, make sure to return it with the following format:

if err != nil {
    errors.New("Failed to do the thing:\n" + err.Error())
}

This will allow us to build our own stack trace which is great for debugging.

Tests

Clone this wiki locally