sortpath

package
v2.0.0-...-c09f89d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 5, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

sortpath support sorting of path that may include number.

A series of path can looks like:

  • Tome1/Chap1/Image1.jpg
  • Tome1/Chap2/Image1.jpg
  • Tome1/Chap10/Image2.jpg

The module will split the string by path, and compare them by decomposing the string and number part.

The module support 3 mode:

  • mode=0 alpha for path and file
  • mode=1 alphanum for path and alpha for file
  • mode=2 alphanum for path and file

Example:

files := []string{
	'T1/C1/Img1.jpg',
	'T1/C2/Img1.jpg',
	'T1/C10/Img1.jpg',
}

sort.Sort(sortpath.By(files, 1))

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func By

func By(filenames []string, mode int) by

use sortpath.By with sort.Sort

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL