aboutsummaryrefslogtreecommitdiff
path: root/README.md
blob: 86dc3078f323f1c07659a11d3f12023bcd978430 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
A Go example
 
You'll need `go` 1.23 at least.
 
There's a [`Makefile`](Makefile), so you can do:
 
    $ make clean
    $ make test
    $ make
    $ make run
 
If you run:
 
    go install golang.org/x/tools/cmd/goimports@latest
    go install github.com/daixiang0/gci@latest
    go install mvdan.cc/gofumpt@latest
 
then you can do `make fmt` to format all the source files.
 
If you `go install
github.com/golangci/golangci-lint/cmd/golangci-lint@latest`, you can
also do `make lint` to get a linting / critique of all the source
files (`lint` runs `fmt` first, so you need to have installed the
packages above as well).
 
Note that the `Makefile` is *for development*, it's not used after the
code is built.
 
## Structure
 
* the entry points go under `cmd/`, with a matching target in the
  `Makefile`
* the `factory` constructs all the singletons that actually do things
  (e.g. listeners, models, clients, business logic objects)
* the `config` handles all configuration for the entire application