Code Monkey home page Code Monkey logo

cashier-tw-homework's Introduction

#cashier-TW-homework(FAILED)

###Installation 确保你安装了golang后执行以下安装命令

go get github.com/jas0ns/cashier-TW-homework
go install github.com/jas0ns/cashier-TW-homework

###Usage 运行题目指定测试用例,请cd到源码目录 (默认为$GOPATH/src/github.com/jas0ns/cashier-TW-homework/)后运行

go test

请参考单元测试代码cashier_test.go中的func Example1~5()使用该模块

###Notice(or Bug) 当为一个商品添加多种优惠的时候,有冲突的优惠需要按优先顺序依次添加,见cashier_test.go/func Example5
例: 需要先添加"买二赠一",再添加"95折",才能正确的使其只享受优先级高的优惠"买二赠一"

###BTW 初学golang,望面试官手下留情

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.