Code Monkey home page Code Monkey logo

split_clone_with_go's Introduction

Splitコマンドのクローン

対応したオプション

b,n,l

対応したイレギュラー入力

以下の場合エラーとなるようにした。

1. 一般

  • ファイル名が存在しない場合
  • オプションが指定されなかった場合

2. オプション

  • バイト単位が整数の場合
  • 行数が整数の場合
  • 数値以外の場合

パフォーマンスに対応する工夫

forによる二重ループを多用しないように意識

配列のスライスを利用し、途中のインデックスからの処理を意識

テストコードのポイント

理想と現実を考慮 当初カバレッジ100%を目標に目指していましたが時間がたりず、優先順位を付けた

作成した関数のうち、標準パッケージを用いている箇所のテストは除外し、ロジックとして実装した部分をテスト対象とした

その他意識したこと

1.引数オプション単位でソースコードを分割

なるべく、公開/非公開を意識し、メインから直接呼び出されない関数は非公開とした

2.デフォルト値を意識

manコマンドで確認できたデフォルト値を利用

3.分割される数をxaa~xzzと仮定

仮定した範囲から分割しきれない場合、最終ファイルに残データを出力するように行った

4.osのIOをなるべく減らした

分割対象のファイルをその都度Openするのではなく、メイン処理で代表して行った

split_clone_with_go's People

Contributors

kushidam 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.