So you decided to help godu out hey? Perfect. Thank you already even for entertaining the idea.
Why for nomral use it is ok to call go get
without go modules, if you are going to make changes to the codebase, please make sure you have Go 1.11 or later intalled and you have got Go modules enabled (GO111MODULE=on
) Extensive Info
Main things to consider when implementing new functionality is packages, there are 3:
files
- godu's file system representation and algorythms for making and changing the file tree structurecommands
- application state representation and functions to change it, all based on the command design patterninteractive
- this is functionality connected to UI of the appmain
- this contains main wiring + tcell.Screen related functionality, this is the only package that is not expected to have 100% test coverage
Before doing significant changes to files
and commands
packages (specially changing the main structures like File and State, please consult the change in form of Github Issue
- Except for
folder *File
property the state should be immutable. I would makefolder
immutable as well but that would mean referencing it as a value and potentially copying 200M of memory every user interaction - Please make sure that you are never using pointers(and arrays) from
oldState
when creatingnewState
in aExecuter
(a.k.a. command)
You would notice that in godu.go
we are walking through the whole folder using
rootFolder := files.WalkFolder(rootFolderName, ioutil.ReadDir, getIgnoredFolders())
The expectation is that the files.File
structure contains only representation of the file system and it is not going to change after calling WalkFolder
When implementing new command please make sure that it's result is captured in a state and that the state is appropriately displayed using InteractiveFolder
(e.g. highlighting selected line in file column)
Expectation is that files
, commands
and interactive
packages will have 100% test coverage. I'm not a testing nazi but I won't have time to checkout every PR and manually retest it and neither will you. We need to be confident that godu
still works after merging your (and any subsequent) PR.