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

【課題2】 #19

Open
wants to merge 52 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
dcf9736
ディレクトリ構造の定義
nasjp Sep 4, 2019
40bd1cb
基本機能の実装
nasjp Sep 4, 2019
a0609ad
README を修正
nasjp Sep 4, 2019
fef87be
makefile の軽微な修正
nasjp Sep 4, 2019
7220a74
READMEの修正
nasjp Sep 4, 2019
7491341
再帰的な処理を追加
nasjp Sep 5, 2019
42b4229
テストデータを修正
nasjp Sep 5, 2019
6198663
file format のチェックを插入
nasjp Sep 5, 2019
9a727db
READMEを修正
nasjp Sep 5, 2019
6c8c679
変換部分を分離
nasjp Sep 6, 2019
2c9f4fc
バグを修正
nasjp Sep 6, 2019
f2c2275
decode 部分を切り出し
nasjp Sep 6, 2019
60b5580
関数名を修正
nasjp Sep 6, 2019
4f04858
ファイルタイプを大文字定数に
nasjp Sep 6, 2019
4acd90b
定数名を修正
nasjp Sep 6, 2019
6e17cda
絶対パス取得の役割をcmd配下に移管
nasjp Sep 6, 2019
39002c4
変換データを返す
nasjp Sep 6, 2019
16edc03
TODO を削除
nasjp Sep 6, 2019
11d72e9
存在しないパスを指定されたときの処理を修正
nasjp Sep 6, 2019
a33a43e
フラグを追加し、デバッグ用ログ処理を削除
nasjp Sep 6, 2019
18e2aa0
成功ログを修正
nasjp Sep 6, 2019
f6e4deb
gifに対応
nasjp Sep 6, 2019
4875c89
コメントを整備
nasjp Sep 6, 2019
5d3419a
flag を修正
nasjp Sep 6, 2019
159371e
コメント及び空行を整備
nasjp Sep 6, 2019
e32bce2
flag メッセージを修正
nasjp Sep 6, 2019
999092c
README を修正
nasjp Sep 6, 2019
c8897bf
README を修正
nasjp Sep 6, 2019
d3c9523
わかりにくい処理にコメントを追記
nasjp Sep 6, 2019
508cee9
画像のバイナリを変更
nasjp Sep 6, 2019
cacf35d
エラー処理の追加
nasjp Sep 9, 2019
17aeea2
コメントを追加
nasjp Sep 9, 2019
8c4a9d2
Makefile のGOMODULE修正
nasjp Sep 10, 2019
1a20f62
コメントを位置を修正
nasjp Sep 10, 2019
c0e3072
NewConfig にテストを追加
nasjp Sep 10, 2019
a84147d
TestGetImageFormatを作成
nasjp Sep 10, 2019
e8aaf4f
imachan package に testdata dir を追加
nasjp Sep 11, 2019
c4be7cc
TestConvert を追加
nasjp Sep 11, 2019
30810b6
TestConfigConvertRec の作成
nasjp Sep 11, 2019
404ae0d
バグ修正
nasjp Sep 11, 2019
4c244dc
関数名をパブリックに
nasjp Sep 11, 2019
f44430f
TestConvertTO... を作成
nasjp Sep 11, 2019
7cb5261
TestConfigConvertRec のサブテスト追加
nasjp Sep 11, 2019
8bbd2ef
SetupTest で Create Dir に対応する
nasjp Sep 11, 2019
67493c2
テストケースを追加
nasjp Sep 14, 2019
a91f5ae
ディレクリを修正
nasjp Sep 14, 2019
5f71a1d
課題2-1を追加
nasjp Sep 14, 2019
acea922
Helperメソッドを使用
nasjp Sep 14, 2019
56df0d5
大文字 format に対応する
nasjp Sep 14, 2019
d4cbc21
file create時にerr処理を実行
nasjp Sep 14, 2019
595fcd2
defer の err処理バグを修正
nasjp Sep 15, 2019
d5371cb
defer の err 処理でべつのエラーが入ってることを考慮
nasjp Sep 15, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
絶対パス取得の役割をcmd配下に移管
  • Loading branch information
nasjp committed Sep 6, 2019
commit 6e17cda08214a3b9a1144a21a1b449e660b525b5
7 changes: 6 additions & 1 deletion kadai1/nas/cmd/imachan/main.go
Original file line number Diff line number Diff line change
@@ -4,6 +4,7 @@ import (
"flag"
"fmt"
"log"
"path/filepath"

"github.com/gopherdojo/dojo7/kadai1/nas/pkg/imachan"
)
@@ -22,7 +23,11 @@ func run() error {
err := fmt.Errorf("no target")
return err
}
c, err := imachan.NewConfig(args[0], "jpeg", "png")
path, err := filepath.Abs(args[0])
if err != nil {
return err
}
c, err := imachan.NewConfig(path, "jpeg", "png")
if err != nil {
return err
}
6 changes: 1 addition & 5 deletions kadai1/nas/pkg/imachan/imachan.go
Original file line number Diff line number Diff line change
@@ -24,11 +24,7 @@ type Config struct {
}

// NewConfig is ...
func NewConfig(dir, fromFormatStr, toFormatStr string) (*Config, error) {
path, err := filepath.Abs(dir)
if err != nil {
return nil, err
}
func NewConfig(path, fromFormatStr, toFormatStr string) (*Config, error) {
fromFormat := getImageFormat(fromFormatStr)
if fromFormat == -1 {
err := fmt.Errorf("undefind %s file format, please choose another", fromFormatStr)