First Things First – Install Golang as a prerequisite to the development. Ensure you follow the complete steps to create the required directory structure and test the installation.
Get The Source
This guide assumes you already have forked the proxy project. If not please for the repo. Once you have successfully forked the repo, clone it on your computer
git clone https://github.com/<your-username>/proxy.git $GOPATH/src/github.com/<your-username>/proxy
Add the upstream proxy project as remote to the local clone to fetch up the updates.
$ cd proxy
$ git remote add upstream https://github.com/kata-containers/proxy.git
The proxy project requires following dependencies to be installed prior to build. Use following command to install them.
$ go get github.com/hashicorp/yamux
$ go get github.com/sirupsen/logrus
Do the first build. This will create the executable file kata-proxy in the proxy directory.
go build -o kata-proxy -ldflags “-X main.version=0.0.1-02a5863f1165b1ee474b41151189c2e1b66f1c40”
To run unit tests run
$ make test
go test -v -race -coverprofile=coverage.txt -covermode=atomic
=== RUN TestUnixAddrParsing
— PASS: TestUnixAddrParsing (0.00s)
=== RUN TestProxy
— PASS: TestProxy (0.05s)
coverage: 44.6% of statements
ok github.com/coolsvap/proxy 1.064s
To remove all generated output files run
$ make clean
rm -f kata-proxy
This is for this time. I am working on setting up the development environment with GolangD IDE. Keep you posted.