lint ignore

This commit is contained in:
Celogeek 2024-03-03 12:31:26 +01:00
parent f8b76a3725
commit 910d0cc3f5
Signed by: celogeek
SSH Key Fingerprint: SHA256:njNJLzoLQdbV9PC6ehcruRb0QnEgxABoCYZ+0+aUIYc
5 changed files with 15 additions and 13 deletions

View File

@ -75,6 +75,7 @@ func (f *FileToUpload) MD5() *string {
if err != nil {
return nil
}
//goland:noinspection GoUnhandledErrorResult
defer file.Close()
hash := md5.New()
if _, err = io.Copy(hash, file); err != nil {
@ -95,6 +96,7 @@ func (f *FileToUpload) CreatedAt() *TimeResult {
if err != nil {
return nil
}
//goland:noinspection GoUnhandledErrorResult
defer et.Close()
var createdAt *time.Time
@ -163,6 +165,7 @@ func (f *FileToUpload) Base64BuildChunk() (chan *FileToUploadChunk, error) {
out := make(chan *FileToUploadChunk, 8)
go func() {
b := make([]byte, ChunkBuffSize)
//goland:noinspection GoUnhandledErrorResult
defer fh.Close()
defer close(out)
ok := false

View File

@ -43,6 +43,7 @@ func (img *ImageDetails) Preview(height int) (string, error) {
if resp.StatusCode != 200 {
return "", fmt.Errorf("[error %d] failed to get image", resp.StatusCode)
}
//goland:noinspection GoUnhandledErrorResult
defer resp.Body.Close()
buf := bytes.NewBuffer([]byte{})
@ -57,6 +58,7 @@ func (img *ImageDetails) Preview(height int) (string, error) {
buf.WriteString(":")
encoder := base64.NewEncoder(base64.StdEncoding, buf)
//goland:noinspection GoUnhandledErrorResult
defer encoder.Close()
if _, err := io.Copy(encoder, resp.Body); err != nil {
return "", err

View File

@ -63,8 +63,10 @@ func (t Tags) Selector(exclude *regexp.Regexp, keepFilter bool, keepPreviousAnsw
tags[tag.Name] = tag
}
//goland:noinspection GoPreferNilSlice
previousAnswer := []string{}
return func() Tags {
//goland:noinspection GoPreferNilSlice
answer := []string{}
_ = survey.AskOne(&survey.MultiSelect{

View File

@ -31,6 +31,7 @@ func (p *Piwigo) VideoJSSync(imageId int) error {
if err != nil {
return err
}
//goland:noinspection GoUnhandledErrorResult
defer r.Body.Close()
return nil
}

View File

@ -1,5 +1,5 @@
/*
Tree builder and viewer
Package tree builder and viewer
This allows you to create a tree of files and display them as a tree or flat view.
@ -32,9 +32,7 @@ type Tree interface {
TreeView() chan string
}
/*
Create a new tree
*/
// New create a new tree
func New() Tree {
return &node{
Name: ".",
@ -73,7 +71,7 @@ func (t *node) Add(name string) Tree {
}
/*
Add a path to your tree, separated with /
AddPath add a path to your tree, separated with /
t.AddPath("a/b/c/d")
*/
@ -85,9 +83,7 @@ func (t *node) AddPath(path string) Tree {
return n
}
/*
Return a sorted list of children
*/
// Children return a sorted list of children
func (t *node) Children() []*node {
children := make([]*node, len(t.Nodes))
i := 0
@ -101,15 +97,13 @@ func (t *node) Children() []*node {
return children
}
/*
Check if your node has a children
*/
// HasChildren Check if your node has a children
func (t *node) HasChildren() bool {
return t.Nodes != nil
}
/*
Return a flat view of your tree
FlatView return a flat view of your tree
for v := range t.FlatView() {
fmt.Println(v)
@ -138,7 +132,7 @@ func (t *node) FlatView() (out chan string) {
}
/*
Return a tree view of your tree
TreeView return a tree view of your tree
for v := range t.TreeView() {
fmt.Println(v)