Skip to content

Commit 308fa7f

Browse files
committedMay 7, 2024
Fix reviewdog
1 parent ae2773a commit 308fa7f

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed
 

‎usecase/csv.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ func (ci *CSVInteractor) List(csvFilePath string) (*model.CSV, error) {
3838

3939
// Dump write contents of DB table to CSV file
4040
func (ci *CSVInteractor) Dump(csvFilePath string, table *model.Table) error {
41-
f, err := os.OpenFile(filepath.Clean(csvFilePath), os.O_RDWR|os.O_CREATE, 0664)
41+
f, err := os.OpenFile(filepath.Clean(csvFilePath), os.O_RDWR|os.O_CREATE, 0600)
4242
if err != nil {
4343
return err
4444
}

‎usecase/json.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ func (i *JSONInteractor) List(jsonFilePath string) (*model.JSON, error) {
2525

2626
// Dump write contents of DB table to JSON file
2727
func (i *JSONInteractor) Dump(jsonFilePath string, table *model.Table) error {
28-
f, err := os.OpenFile(filepath.Clean(jsonFilePath), os.O_RDWR|os.O_CREATE, 0664)
28+
f, err := os.OpenFile(filepath.Clean(jsonFilePath), os.O_RDWR|os.O_CREATE, 0600)
2929
if err != nil {
3030
return err
3131
}

‎usecase/tsv.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package usecase
22

33
import (
44
"os"
5+
"path/filepath"
56

67
"github.com/nao1215/sqly/domain/model"
78
"github.com/nao1215/sqly/domain/repository"
@@ -21,7 +22,7 @@ func NewTSVInteractor(r repository.TSVRepository) *TSVInteractor {
2122
// The sqly command does not open many TSV files. Therefore, the file is
2223
// opened and closed in the usecase layer without worrying about processing speed.
2324
func (ti *TSVInteractor) List(tsvFilePath string) (*model.TSV, error) {
24-
f, err := os.Open(tsvFilePath)
25+
f, err := os.Open(filepath.Clean(tsvFilePath))
2526
if err != nil {
2627
return nil, err
2728
}

0 commit comments

Comments
 (0)