GithubHelp home page GithubHelp logo

customerimporter's Introduction

customerimporter

customerimporter reads from the given csv file and returns a sorted (data structure of your choice) of email domains along with the number of customers with e-mail addresses for each domain.

Run

$ go run main.go csv/file/path

Test

ci_test.go contains 2 tests. The first one tests how my application handles different CSV files (empty, invalid format, invalid email, and valid). The second one tests the output of the application.

$ go test ./customerimporter -v

Benchmark

ci_test.go also contains a simple benchmark of my application. To run the benchmark just insert the following command from the root src:

$ go test -bench=. ./customerimporter

In future versions, this benchmark could be improved.

Makefile

There is also a simple makefile that can be used instead of go commands. The available commands are: all, build, tests, and benchmark. If you use only make or make all, it is required to pass a csv file path in CSV variable.

$ make CSV=customers.csv

Files

The csv files used during tests can be found in customerimporter/csv_tests.

Important

During this implementation I've assumed a few things: (i) the header repetition could occur in any line, which causes some unnecessary checking; (ii) empty files does not cause any errors; (iii) if the CSV file contains an invalid email, the function returns an error.

customerimporter's People

Contributors

rodrigopmello avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.