2. Most of the time the new library has its own `go.mod` and `go.sum` file. You need to copy and paste all `required` dependencies from the new libraries `go.mod` to the `go.mod` in the bitmaskcore directory. Similarly, you have also to take care about `replace` entries.
3. delete `go.mod` and `go.sum` from the new library
```
# you should be in bitmaskcore
cd <new_lib_directory>
rm go.mod go.sum
```
4. create a patch from the diff
```
# you should be in bitmaskcore/<new_lib_directory>
git diff > ../<new_lib>.patch
git stash
cd ..
```
4. Make sure the `bitmaskcore/golang` directory is empty.
```
# you should be in bitmaskcore
rm -rf ./golang/*
```
5. And let go add any missing modules.
```
# you should be in bitmaskcore
go mod tidy
```
6. Update [build_core.sh](build_core.sh) and add some lines of code below the exting patches section