mirror of
https://github.com/gotenberg/gotenberg.git
synced 2026-10-11 14:53:17 +01:00
refactor: adopt strings.Cut and strings.SplitSeq
Applies what go fix now proposes, so make fmt is a no-op on a clean tree instead of dirtying these two files on every run. Both rewrites are equivalent: Cut's first result matches SplitN(s, sep, 2)[0], and SplitSeq iterates the same substrings without building the intermediate slice.
This commit is contained in:
@@ -180,7 +180,7 @@ func (engine *PdfCpu) listImages(ctx context.Context, inputPath string) ([]pdfcp
|
||||
// their second column is not a numeric object number.
|
||||
func parseImagesList(output string) []pdfcpuImage {
|
||||
var images []pdfcpuImage
|
||||
for _, line := range strings.Split(output, "\n") {
|
||||
for line := range strings.SplitSeq(output, "\n") {
|
||||
cols := strings.Split(line, "│")
|
||||
if len(cols) < 9 {
|
||||
continue
|
||||
|
||||
Reference in New Issue
Block a user