Skip to content

dockerian/go-coding

Repository files navigation

go-coding

This is a project for Golang exercises.

Code Coverage GoDoc Build Status Go ReportCard

Project Structure


Introduction


Using Docker

Installing Go may not be needed if you choose to use Docker. With running a go-coding container, you can clone this repo at any location on your disk, for example $HOME/projects, without having to set $GOPATH. And you can still access (e.g. for editing) the source code locally.

```
# assume in your projects folder
cd $HOME/projects
git clone https://github.com/dockerian/go-coding.git
cd go-coding
```

To build and run in docker container, see here.


Build, test and run

The Makefile has included build, test, run targets. For example, to build, simply change to the project directory and run

make build # or ./build.sh

or to run tests

make test  # or ./run.sh test


End-to-end tests

  • MessageSender test
    • In order to run the test, inject environment variables to set user, pass, recipient, e.g.

      MAIL_TO='[email protected]' \
      MAIL_USER='[email protected]' MAIL_PASS='pass!wd' \
      make e2e
      

      Default mail server (MAIL_HOST): smtp.office365.com.
      Default auth: MAIL_TLS=true (otherwise using just LoginAuth)
      Default sender (MAIL_USER): [email protected].
      And default recipient (MAIL_TO): [email protected].


Documentation

This project uses godocdown and $(DOC_PACKAGES) in Makefile to generate documentations for some library packages

make doc


Learning Go


Code Coverage GoDoc Build Status Go ReportCard