maputil
Package maputil provides lodash-style object helpers for maps.
import "github.com/sahilkhaire/gox/maputil"
Select a symbol below — each page explains what it does, shows Node.js vs Go comparisons, and includes a runnable example.
Functions
| Symbol | Node.js | Kind | Summary |
|---|---|---|---|
| Clone | _.cloneDeep(obj) | func | Clone returns a shallow copy of m (lodash clone). |
| Get | _.get(obj, "a.b") | func | Get reads a nested value from m using dot-separated path (lodash get). |
| Invert | _.invert(obj) | func | Invert swaps keys and values; duplicate values overwrite (lodash invert). |
| Keys | Object.keys(obj) | func | Keys returns map keys (Object.keys). |
| Merge | _.merge(a, b) | func | Merge copies keys from sources into dst, later maps override (lodash merge, shallow). |
| Omit | _.omit(obj, keys) | func | Omit returns a new map without the given keys (lodash omit). |
| Pick | _.pick(obj, keys) | func | Pick returns a new map with only the given keys (lodash pick). |
| Set | _.set(obj, "a.b", v) | func | Set writes value at dot-separated path, creating intermediate maps (lodash set). |
| Values | Object.values(obj) | func | Values returns map values (Object.values). |