Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kadai2-dshirae #16

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Kadai2-dshirae #16

wants to merge 2 commits into from

Conversation

showchan
Copy link

課題2

テストを書いてみよう

1回目の宿題のテストを作ってみてください

  • テストのしやすさを考えてリファクタリングしてみる
    課題1に実装しなかった、ユーザ定義型を作ってみる を実装した
  • テストのカバレッジを取ってみる
    課題提出時コードにて80% のカバレッジ
    $ go test -coverprofile=cover.out -run ''
    $ go tool cover -html=cover.out
  • テーブル駆動テストを行う
    実装しました
  • テストヘルパーを作ってみる
    実装したが、うまく使えてない気がする。(再調査)

io.Readerとio.Writer

io.Readerとio.Writerについて調べてみよう

  • 標準パッケージでどのように使われているか
    [WIP]
  • io.Readerとio.Writerがあることでどういう利点があるのか具体例を挙げて考えてみる
    抽象化された事でOS間の違いが吸収される。標準出力(console)など

flag.Parse()

if (flag.NArg() == 0) && (flag.NFlag() == 0) {
fmt.Println("Usage: chimgs DIR [-i=imgext] [-o=imgext]")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

標準エラー出力にだす

}
dirname := flag.Arg(0)

filepath.Walk(dirname,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

エラー処理

if err != nil {
return err
}
defer savefile.Close()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

エラー処理

"os"
"path/filepath"

"./convert"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

相対パスにしない

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants