Skip to content

floriantoufet/fizzbuzz

Repository files navigation

Fizz Buzz Go Reference

Returns a list of strings with numbers from 1 to limit, where: all multiples of int1 are replaced by str1, all multiples of int2 are replaced by str2, all multiples of int1 and int2 are replaced by str1str2. :

Download binaries

Go to latest release

Run

Linux:

$ chmod a+x fizz_buzz_linux-amd64
$ ./fizz_buzz_linux-amd64

MacOS:

$ chmod a+x fizz_buzz_darwin-amd64
$ ./fizz_buzz_darwin-amd64

Windows:

C:\....\fizz_buzz_windows-amd64.exe

Config

Create env.yml in conf directory

transports:
  http:
    host: 127.0.0.1
    port: 8080

logger:
  env: "dev" # Supports dev or prod value

Launch with environment variable

$ CONF_ENV=env ./fizz_buzz_darwin-amd64

CONF_ENV take value of wanted conf file

Call endpoints

Swaggers

All endpoints are detailed in swagger.yml

Godoc

Available here

Conditions

  • fizz string and buzz string do not exceed 100 characters
  • modulus and limit are strictly positives
  • limit does not exceed 1000

Tests

Requirements

Run tests

$ ./run_test.sh