mirror of
https://github.com/celogeek/piwigo-cli.git
synced 2025-05-24 17:52:36 +02:00
lint ignore
This commit is contained in:
parent
f8b76a3725
commit
910d0cc3f5
@ -75,6 +75,7 @@ func (f *FileToUpload) MD5() *string {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
//goland:noinspection GoUnhandledErrorResult
|
||||||
defer file.Close()
|
defer file.Close()
|
||||||
hash := md5.New()
|
hash := md5.New()
|
||||||
if _, err = io.Copy(hash, file); err != nil {
|
if _, err = io.Copy(hash, file); err != nil {
|
||||||
@ -95,6 +96,7 @@ func (f *FileToUpload) CreatedAt() *TimeResult {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
//goland:noinspection GoUnhandledErrorResult
|
||||||
defer et.Close()
|
defer et.Close()
|
||||||
|
|
||||||
var createdAt *time.Time
|
var createdAt *time.Time
|
||||||
@ -163,6 +165,7 @@ func (f *FileToUpload) Base64BuildChunk() (chan *FileToUploadChunk, error) {
|
|||||||
out := make(chan *FileToUploadChunk, 8)
|
out := make(chan *FileToUploadChunk, 8)
|
||||||
go func() {
|
go func() {
|
||||||
b := make([]byte, ChunkBuffSize)
|
b := make([]byte, ChunkBuffSize)
|
||||||
|
//goland:noinspection GoUnhandledErrorResult
|
||||||
defer fh.Close()
|
defer fh.Close()
|
||||||
defer close(out)
|
defer close(out)
|
||||||
ok := false
|
ok := false
|
||||||
|
@ -43,6 +43,7 @@ func (img *ImageDetails) Preview(height int) (string, error) {
|
|||||||
if resp.StatusCode != 200 {
|
if resp.StatusCode != 200 {
|
||||||
return "", fmt.Errorf("[error %d] failed to get image", resp.StatusCode)
|
return "", fmt.Errorf("[error %d] failed to get image", resp.StatusCode)
|
||||||
}
|
}
|
||||||
|
//goland:noinspection GoUnhandledErrorResult
|
||||||
defer resp.Body.Close()
|
defer resp.Body.Close()
|
||||||
|
|
||||||
buf := bytes.NewBuffer([]byte{})
|
buf := bytes.NewBuffer([]byte{})
|
||||||
@ -57,6 +58,7 @@ func (img *ImageDetails) Preview(height int) (string, error) {
|
|||||||
buf.WriteString(":")
|
buf.WriteString(":")
|
||||||
|
|
||||||
encoder := base64.NewEncoder(base64.StdEncoding, buf)
|
encoder := base64.NewEncoder(base64.StdEncoding, buf)
|
||||||
|
//goland:noinspection GoUnhandledErrorResult
|
||||||
defer encoder.Close()
|
defer encoder.Close()
|
||||||
if _, err := io.Copy(encoder, resp.Body); err != nil {
|
if _, err := io.Copy(encoder, resp.Body); err != nil {
|
||||||
return "", err
|
return "", err
|
||||||
|
@ -63,8 +63,10 @@ func (t Tags) Selector(exclude *regexp.Regexp, keepFilter bool, keepPreviousAnsw
|
|||||||
tags[tag.Name] = tag
|
tags[tag.Name] = tag
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//goland:noinspection GoPreferNilSlice
|
||||||
previousAnswer := []string{}
|
previousAnswer := []string{}
|
||||||
return func() Tags {
|
return func() Tags {
|
||||||
|
//goland:noinspection GoPreferNilSlice
|
||||||
answer := []string{}
|
answer := []string{}
|
||||||
|
|
||||||
_ = survey.AskOne(&survey.MultiSelect{
|
_ = survey.AskOne(&survey.MultiSelect{
|
||||||
|
@ -31,6 +31,7 @@ func (p *Piwigo) VideoJSSync(imageId int) error {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
//goland:noinspection GoUnhandledErrorResult
|
||||||
defer r.Body.Close()
|
defer r.Body.Close()
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
@ -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.
|
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
|
TreeView() chan string
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
// New create a new tree
|
||||||
Create a new tree
|
|
||||||
*/
|
|
||||||
func New() Tree {
|
func New() Tree {
|
||||||
return &node{
|
return &node{
|
||||||
Name: ".",
|
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")
|
t.AddPath("a/b/c/d")
|
||||||
*/
|
*/
|
||||||
@ -85,9 +83,7 @@ func (t *node) AddPath(path string) Tree {
|
|||||||
return n
|
return n
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
// Children return a sorted list of children
|
||||||
Return a sorted list of children
|
|
||||||
*/
|
|
||||||
func (t *node) Children() []*node {
|
func (t *node) Children() []*node {
|
||||||
children := make([]*node, len(t.Nodes))
|
children := make([]*node, len(t.Nodes))
|
||||||
i := 0
|
i := 0
|
||||||
@ -101,15 +97,13 @@ func (t *node) Children() []*node {
|
|||||||
return children
|
return children
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
// HasChildren Check if your node has a children
|
||||||
Check if your node has a children
|
|
||||||
*/
|
|
||||||
func (t *node) HasChildren() bool {
|
func (t *node) HasChildren() bool {
|
||||||
return t.Nodes != nil
|
return t.Nodes != nil
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Return a flat view of your tree
|
FlatView return a flat view of your tree
|
||||||
|
|
||||||
for v := range t.FlatView() {
|
for v := range t.FlatView() {
|
||||||
fmt.Println(v)
|
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() {
|
for v := range t.TreeView() {
|
||||||
fmt.Println(v)
|
fmt.Println(v)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user