stash/pkg/autotag
SmallCoccinelle 8b7720e3bf
Enable the appendAssign lint check (#1865)
* Make copies of buffers

Avoid reusing one of the incoming arrays as a append extension, and
make a copy of the data. It's cleaner in the long run and possibly
easier for the GC to maintain.

* Avoid appendAssign problems in tag code

Reuse the existing slice when appending.

* Fix appendAssign in encoder_scene_preview_chunk

Appending and creating a new slice is somewhat unintuitive since the
underlying slice might be extended to satisfy the new capacity. This
sometimes leads to faulty logic.

Rewrite the code so it reuses `args` for all appending, and builds one
array clearly in the code. It follows the general style of the function
where `args` is being built in small incremental batches and avoids
the introduction of new names.

* Enable the appendAssign check

This makes us pass all gocritic warnings.

Co-authored-by: WithoutPants <53250216+WithoutPants@users.noreply.github.com>
2021-10-20 16:34:19 +11:00
..
gallery.go Autotag scraper (#1817) 2021-10-11 23:06:06 +11:00
gallery_test.go Enable safe linters (#1786) 2021-10-03 11:48:03 +11:00
image.go Autotag scraper (#1817) 2021-10-11 23:06:06 +11:00
image_test.go Enable safe linters (#1786) 2021-10-03 11:48:03 +11:00
integration_test.go refactor: move from io/ioutil to io and os package (#1772) 2021-09-27 10:55:23 +10:00
performer.go Autotag scraper (#1817) 2021-10-11 23:06:06 +11:00
performer_test.go Enable safe linters (#1786) 2021-10-03 11:48:03 +11:00
scene.go Autotag scraper (#1817) 2021-10-11 23:06:06 +11:00
scene_test.go Enable the appendAssign lint check (#1865) 2021-10-20 16:34:19 +11:00
studio.go Autotag scraper (#1817) 2021-10-11 23:06:06 +11:00
studio_test.go Enable safe linters (#1786) 2021-10-03 11:48:03 +11:00
tag.go Autotag scraper (#1817) 2021-10-11 23:06:06 +11:00
tag_test.go Enable safe linters (#1786) 2021-10-03 11:48:03 +11:00
tagger.go Autotag scraper (#1817) 2021-10-11 23:06:06 +11:00