-
Notifications
You must be signed in to change notification settings - Fork 17
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 sminamot #30
base: master
Are you sure you want to change the base?
Kadai2 sminamot #30
Conversation
return (e == "jpg" || e == "png" || e == "gif") | ||
} | ||
|
||
func filename(f, src, dst string) string { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
この関数名で拡張子を変更されると戸惑うのでもう少し別の名前をつけてやってください
内部実装を見れば何をしているかはわかりますが、 filename という関数名だけを見ると foo/bar.png
を渡すと拡張子を除いた文字列が返ってくるようなものというイメージを受けます。
} | ||
|
||
func TestNew(t *testing.T) { | ||
tests := []testNewStruct{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ここだけ struct の型を定義をしたのはなぜでしょう?
他のテストと共通化するぞ!という使い方をしないとあまりメリットがなさそうな感じです。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
あと testNewStruct
という名前がちょっと変...
僕が名前つけると testcase
とかになると思います。
io.Readerとio.Writerについて調べてみよう
1回目の宿題のテストを作ってみて下さい