sortpath

package
v2.7.2 Latest Latest
Warning

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

Go to latest
Published: May 9, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package sortpath support sorting of path that may include number.

A series of path can look 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 alphanumeric for path and alpha for file
  • mode=2 alphanumeric 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) sort.Interface

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