Program that gets taxi fares in Go.
- Run using
go run
- Build a binary with
go build
and run it - Run using Docker
- Make sure you already install Go 1.21 https://go.dev/dl in your machine>
- Navigate to the project directory: e.g.
cd taxi-fares
- Run command :
go mod download
to download all dependencies - Run command :
go run main.go
to run the program
- Make sure you already install Go 1.21 https://go.dev/dl in your machine>
- Navigate to the project directory: e.g.
cd taxi-fares
- Run command :
go mod download
to download all dependencies - Run command :
go build -o {binary_output_name} .
e.g.go build -o main .
- Execute your binary
- If you are using mac/linux you can run command
./{binary-name}
e.g../main
- If you are using windows you can run command
start {file_name.exe}
e.g.start main.exe
- If you are using mac/linux you can run command
- Make sure you already install Docker https://docs.docker.com/get-docker in your machine>
- Navigate to the project directory: e.g.
cd taxi-fares
- Run command :
docker build -t taxi-fares .
to create docker image - Run command :
docker run -i -t -v {dir_on_your_machine}:/app/{log_dir} taxi-fares
to run the program e.g.docker run -i -t -v ./log:/app/log taxi-fares
{dir_on_your_machine}
: directory to store log file on your machine{log_dir}
: log directory path, same withfile
onconfig.yaml
but without filename e.g. in yourconfig.yaml
the value islog/app.log
you need to input onlylog