fixed linter warnings

This commit is contained in:
2024-12-18 18:51:50 +01:00
parent feb9032d28
commit 3eab9efc13
4 changed files with 8 additions and 7 deletions

1
.gitignore vendored
View File

@@ -3,3 +3,4 @@ anydb
*.db *.db
coverage.out coverage.out
*.json *.json
releases

View File

@@ -43,12 +43,12 @@ ifdef HAVE_POD
echo "var manpage = \`" >> cmd/$*.go echo "var manpage = \`" >> cmd/$*.go
pod2text $*.pod >> cmd/$*.go pod2text $*.pod >> cmd/$*.go
echo "\`" >> cmd/$*.go echo "\`" >> cmd/$*.go
echo "var usage = \`" >> cmd/$*.go
awk '/SYNOPS/{f=1;next} /DESCR/{f=0} f' $*.pod | sed 's/^ //' >> cmd/$*.go
echo "\`" >> cmd/$*.go
endif endif
# echo "var usage = \`" >> cmd/$*.go
# awk '/SYNOPS/{f=1;next} /DESCR/{f=0} f' $*.pod | sed 's/^ //' >> cmd/$*.go
# echo "\`" >> cmd/$*.go
buildlocal: buildlocal:
go build -ldflags "-X 'github.com/tlinden/anydb/cfg.VERSION=$(VERSION)'" go build -ldflags "-X 'github.com/tlinden/anydb/cfg.VERSION=$(VERSION)'"

View File

@@ -38,7 +38,9 @@ const BucketData string = "data"
func New(file string, debug bool) (*DB, error) { func New(file string, debug bool) (*DB, error) {
if _, err := os.Stat(filepath.Dir(file)); os.IsNotExist(err) { if _, err := os.Stat(filepath.Dir(file)); os.IsNotExist(err) {
os.MkdirAll(filepath.Dir(file), 0700) if err := os.MkdirAll(filepath.Dir(file), 0700); err != nil {
return nil, err
}
} }
return &DB{Debug: debug, Dbfile: file}, nil return &DB{Debug: debug, Dbfile: file}, nil

View File

@@ -27,8 +27,6 @@ func List(writer io.Writer, conf *cfg.Config, entries app.DbEntries) error {
default: default:
return errors.New("unsupported mode") return errors.New("unsupported mode")
} }
return nil
} }
func ListJson(writer io.Writer, conf *cfg.Config, entries app.DbEntries) error { func ListJson(writer io.Writer, conf *cfg.Config, entries app.DbEntries) error {