https://github.com/bryanaustin/structquery
Query data structures using string path in Go
https://github.com/bryanaustin/structquery
data-structures go query
Last synced: 17 days ago
JSON representation
Query data structures using string path in Go
- Host: GitHub
- URL: https://github.com/bryanaustin/structquery
- Owner: bryanaustin
- License: mit
- Created: 2023-08-03T19:19:26.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2024-05-05T15:24:30.000Z (almost 2 years ago)
- Last Synced: 2024-05-05T16:25:52.857Z (almost 2 years ago)
- Topics: data-structures, go, query
- Language: Go
- Homepage:
- Size: 21.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# structquery
Query data structures using string path in Go
**Note: This project is incomplete, not stable, and most features don't work. I am not working on it at the moment. I am shelving it for work later.**
Using an Xpath-like query language to get, add, remove, or replace values in a Go data structure. Great for dynamic data structures.
## Example
```go
package main
import (
"fmt"
"github.com/bryanaustin/structquery"
)
func main() {
x := map[string]int{"one":1, "two":2, "ten":10}
y, _ := structquery.Get(x, "two")
fmt.Println(y[0])
// Output: 2
}
```