Repository navigation
Conversation
script to get images
- add existance - set exit code
- create new function Convert which can convert both jpg -> png, png -> jpg - change not to print error in case of error but return error - use defer to close file
imageConverter to imgcnv
add mycat
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
課題2を作成しました。
もしお時間があれば、レビューコメントをいただけますと幸いです。
よろしくお願いいたします。
【内容】
以下README.mdコピペ(コメントはREADME.mdの方にいただけますと幸いです)
--
io.Reader と io.Writer について
とは?
io.Reader: io パッケージで定義されているインターフェイス。以下のような Read 関数を実装している型を抽象化して扱うことができる。
io.Writer も同様に以下のような Write 関数を実装している型を抽象化して扱うことができる。
標準パッケージでどう使われている??
例. os.MultiReader
複数の Reader を一つの io.Reader にまとめることができる。
何が嬉しい?
io.Reader を実装している型ならなんでもまとめられる。
なんでも OK。読み取り先を気にしないで扱える。
具体例 mycat
オプションなしのシンプルな cat コマンド。
ソース(import、エラー処理等は省略。全体は mycat/mycat.go 参照)
画像変換コマンド
課題1の画像変換コマンドにテストを追加しました。
テスト
実行
カバレッジ
89.7%
$ go test -coverprofile=profile github.com/dai65527/gopherdojo-studyroom/kadai1/imgcnv ok github.com/dai65527/gopherdojo-studyroom/kadai1/imgcnv 0.707s coverage: 89.7% of statements機能
コマンドライン引数に指定したディレクトリ以下の画像ファイルを変換します。
対応ファイル形式
※ その他の形式のファイル/ディレクトリは無視されます。
使い方
コンパイル
実行
jpg から png
png から jpg
オプション
-i: 入力画像形式(デフォルト: png)-o: 出力画像形式(デフォルト: jpg)