Skip to content

Kadai2 miyahara - #31

Open
hikaru7719 wants to merge 3 commits into
masterfrom
kadai2-miyahara
Open

Kadai2 miyahara#31
hikaru7719 wants to merge 3 commits into
masterfrom
kadai2-miyahara

Conversation

@hikaru7719

Copy link
Copy Markdown

課題2のPRです。(まだ途中)
よろしくおねがいします。

io.Readerとio.Writer

  • io.Readerとio.Writerについて調べてみよう ( Reader_and_Writer.md )
    • 標準パッケージでどのように使われているか
    • io.Readerとio.Writerがあることでどういう利点があるのか具体例を挙げて考えてみる

テストを書いてみよう

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

  • テストのしやすさを考えてリファクタリングしてみる
  • テストのカバレッジを取ってみる
  • テーブル駆動テストを行う
  • テストヘルパーを作ってみる

@tenntenn tenntenn added the kadai2 課題2 label Nov 19, 2018
}

outputFile, err := os.Create(fileset.outputFileName)
defer outputFile.Close()

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

https://play.golang.org/p/S9YecKjLVo8
例えば、すでにあるディレクトリに対して os.Create を実行します。
当然エラーが返ってきますが、そのとき outputFile の中身はどうなっていますか?
その場合に outputFile.Close() を呼ぶとどうなるか試してみてください。


// outputFilePath returns output file path to correspond input file path.
func (c Converter) outputFilePath(inputFileName string) string {
stringSlice := strings.Split(inputFileName, ".")

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Mac だと /Applications/Slack.app/Contents/Resources/app.asar.unpacked/src/static/slack-menubar-highlight.png というパスに画像ファイルがあるんですが、正しく変換されますか?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kadai2 課題2

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants