23_code-organization/

directory
v0.0.0-...-baf0b24 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 18, 2020 License: MIT

README

Great reference

Alex Edwards Code Organization Article

Code organization

How you organize your code depends upon the project and your abilities.

Do not sacrifice simplicity & readability for brevity & cleverness.

Your goal should be to write code which is maintainable. This means that an intermediate developer should be able to sit down, read your code, understand it, and work with it.

Different Approaches

One package

When needed we can put variables in the package scope

Two packages

We will import the code from the second package when needed

Three+ packages with package for config variables

We will import the code from the config package when needed. The config package will hold variables like DB and TPL

FYI: there is no global scope in Go

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL