Skip to content

Customized sorting library using the sort package from Go's standard library

Notifications You must be signed in to change notification settings

cpustejovsky/customsortgo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

53 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Custom Sort Go (CS:GO)

csgo300

Aside from my punny acronym, this library is to have a collection of custom applications of the sort package and other sorting algorithms.

Use

Pure Package

To prevent mutations of the original slice, I created a package that returns a new sorted or reverse sorted slice.

Example

package main

import (
	"fmt"
	csgo "github.com/cpustejovsky/customsortgo/pure"
)

func main() {
	list := []string{"cat", "albatross", "dolphin", "bee", "zebra", "aardvark"}
	sorted := csgo.NewSortedStrings(list)
	fmt.Println(list)   // [cat albatross dolphin bee zebra aardvark]
	fmt.Println(sorted) // [aardvark albatross bee cat dolphin zebra]
}

About

Customized sorting library using the sort package from Go's standard library

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages