Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

ryokky59 / 課題1 #9

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

Open
ryokky59 wants to merge 2 commits into master
base: master
Choose a base branch
Loading
from kadai1-ryokky59
Open

ryokky59 / 課題1 #9

ryokky59 wants to merge 2 commits into master from kadai1-ryokky59

Conversation

@ryokky59
Copy link

@ryokky59 ryokky59 commented Jul 8, 2020
edited by hiroygo
Loading

READMEより引用

課題1 画像変換コマンドを作ろう

課題内容

次の仕様を満たすコマンドを作って下さい

  • ディレクトリを指定する
  • 指定したディレクトリ以下のJPGファイルをPNGに変換(デフォルト)
  • ディレクトリ以下は再帰的に処理する
  • 変換前と変換後の画像形式を指定できる(オプション)

以下を満たすように開発してください

  • mainパッケージと分離する
  • 自作パッケージと標準パッケージと準標準パッケージのみ使う
    • 準標準パッケージ:golang.org/x以下のパッケージ
  • ユーザ定義型を作ってみる
  • GoDocを生成してみる
  • Go Modulesを使ってみる

動作例

$ go build -o imgconv
$ ./imgconv -dir ./img
 or
$ ./imgconv -dir ./img -from=png -to=jpg
-dir 対象のディレクトリのパスを指定
-from 変換する予定の画像の拡張子を指定
-to 変換後の画像の拡張子を指定

感想

「ユーザ定義型を作ってみる」という課題がどうしようか結構迷いました。
特になくても作れそうだったのでどう取り入れればわかりやすいかと自分なりに考えてやってみました。

また、GoDocも普段あまり書くことを意識していなかったのでこれで良さそうなのかわかっていないです。
publicなものだけに記述していますが、GoDocの事を考えてもうすこしpublicに切り出せるものは出してあげても良かったのかなと思ったりしています。

@tenntenn tenntenn added the kadai1 課題1 label Jul 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

kadai1 課題1

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /