go-buddy

module
v0.0.0-...-97e25f3 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2020 License: MIT

README

go-buddy

Helper methods and functions for builtin Go types.

Usage

Map

Iterate over map keys in the specified order:

import (
    _m "github.com/AgentCoop/go-buddy/_map"
)

ageNameMap := _m.IterableMap{
    22: "John",
    12: "Bill",
    23: "David",
    14: "Andrew",
}
ageNameMap.iterateOver(func(key interface{}, val interface{}, elIdx int) {
    fmt.Printf("Age: %d, Name: %s, index: %d\n", key.(int), val, elIdx)
}, _m.ORDER_ASC)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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