git clone git@github.com:SOMAS2022/SOMAS2022.git
cd SOMAS2022
make
If running a team experiment, eg for team 0, set the MODE
env variable in .env
MODE=0
Following some Golang Standards [1] , [2] and previous year project structures (2021)
.
├── cmd
│ └── (Executable Outputs)
├── docs
│ └── (Documentation Files)
├── web
│ └── (Frontend/Backend Implementation)
├── pkg
│ └── infra
│ └── (Infrastructure Implementation)
| └── teams
| └── (Individual Team Agents/Experiments)
├── .env (Environmental variables for Infrastructure)
└── scripts
└── (Automation/Execution scripts)
A lot of these guidelines are from the SOMAS2021 and SOMAS2020 repos :)
struct
s:type S struct {
name string
age int
}
s1 := S {"pitt", 42} // NO
s2 := S {"pitt"} // NO (even though it initialises age to 0)
s3 := S{name: "pitt", age: 42} // OK, if we add fields into S, this will still be correct
s4 := S{name: "pittson"} // OK if `pittson`'s age is 0
Write tests where required. There are many guides online on how to do this in Golang. Tests will be run alongside CI when you pull into the main repo. If anyone breaks anything, it's easy to observe that if you have tests. Otherwise, your code will be broken unknowingly.
DO NOT TOUCH code you don't own unless you have a good reason to. If you have a good reason to, do it in a separate PR and notify the owners of the code.
Do not use panic
or die
- return an error
instead!
Do not use system-specific packages (e.g. internal/syscall/unix
).
Use the superior errors.Errorf
to create your errors so that we have a stack trace.
main
branch. Make your own branch and create a PR into main
when it's ready for review.teamX-FEATURE_NAME-WHATEVER_YOU_LIKE_HERE
git push --force-with-lease
instead.teamX-FEATURE_NAME
. When the feature
is complete, then create a PR into main
.main
branch. Merge commits are not
allowed: learn how to rebase
.