Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/f2prateek/plectrum
Plectrum lets you quickly pick specific keys in map.
https://github.com/f2prateek/plectrum
Last synced: about 1 month ago
JSON representation
Plectrum lets you quickly pick specific keys in map.
- Host: GitHub
- URL: https://github.com/f2prateek/plectrum
- Owner: f2prateek
- Created: 2015-03-08T04:11:10.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-03-08T05:10:03.000Z (over 9 years ago)
- Last Synced: 2023-03-24T08:21:51.087Z (over 1 year ago)
- Language: Go
- Homepage:
- Size: 117 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Plectrum
Plectrum lets you quickly pick specific keys in map.
## Example
```go
event := map[string]interface{}{
"name": map[string]interface{}{
"first": "prateek",
"last": "srivastava",
},
"username": "f2prateek",
"age": 23
}Pick(event, []string{"username", "age"})
// {"username": "f2prateek", "age": 23}Pick(event, []string{"username", "foo"})
// {"username": "f2prateek"}
```