Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/d-tsuji/qiisync
Browse files Browse the repository at this point in the history
  • Loading branch information
d-tsuji committed Apr 27, 2020
2 parents f1c253c + 9ca8b75 commit 3fea395
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 13 deletions.
4 changes: 4 additions & 0 deletions broker.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,10 @@ func (b *Broker) FetchLocalArticles() (articles map[string]*Article, err error)
}

func dirwalk(dir string) ([]string, error) {
err := os.MkdirAll(dir, 0755)
if err != nil {
return nil, fmt.Errorf("make dir: %w", err)
}
files, err := ioutil.ReadDir(dir)
if err != nil {
return nil, fmt.Errorf("read dir: %w", err)
Expand Down
13 changes: 0 additions & 13 deletions broker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -909,12 +909,6 @@ func Test_fetchLocalArticles(t *testing.T) {
Local: localConfig{Dir: filepath.Join("testdata", "duplicate")}}},
wantErr: true,
},
{
name: "dummy_dir",
fields: fields{config: &Config{
Local: localConfig{Dir: "dummy"}}},
wantErr: true,
},
}

if err := os.Chtimes(filepath.Join("testdata", "article", "20_test_article_posted.md"), updateAt, updateAt); err != nil {
Expand Down Expand Up @@ -1159,13 +1153,6 @@ func Test_dirwalk(t *testing.T) {
}
}

func Test_dirwalk_dummyDir(t *testing.T) {
_, err := dirwalk("dummy")
if err == nil {
t.Errorf("expect to occur error but nothing: %v", err)
}
}

func setup() (broker *Broker, mux *http.ServeMux, serverURL string, teardown func()) {
mux = http.NewServeMux()

Expand Down

0 comments on commit 3fea395

Please sign in to comment.