https://github.com/tenntenn/gpath
gpath is a Go package to access a field by a path using reflect pacakge
https://github.com/tenntenn/gpath
golang reflect static-analysis
Last synced: 4 months ago
JSON representation
gpath is a Go package to access a field by a path using reflect pacakge
- Host: GitHub
- URL: https://github.com/tenntenn/gpath
- Owner: tenntenn
- License: mit
- Created: 2017-05-24T06:24:18.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-06-04T08:31:39.000Z (over 8 years ago)
- Last Synced: 2025-06-20T02:04:17.469Z (5 months ago)
- Topics: golang, reflect, static-analysis
- Language: Go
- Homepage:
- Size: 15.6 KB
- Stars: 40
- Watchers: 3
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-go-cn - gpath
- awesome-go - gpath - gpath is a Go package to access a field by a path using reflect pacakge - ★ 25 (Utilities)
- awesome-go - gpath - Library to simplify access struct fields with Go's expression in reflection. (Utilities / Advanced Console UIs)
- awesome-go-cn - gpath
- awesome-go-plus - gpath - Library to simplify access struct fields with Go's expression in reflection.  (Reflection / HTTP Clients)
- awesome-go - gpath - Library to simplify access struct fields with Go's expression in reflection. (Utilities / Utility/Miscellaneous)
- awesome-go - gpath - | - | - | (Utilities / HTTP Clients)
- awesome-go - gpath - Library to simplify access struct fields with Go's expression in reflection. (Utilities / Utility/Miscellaneous)
- awesome-go-zh - gpath
- awesome-go - gpath - Library to simplify access struct fields with Go's expression in reflection. - :arrow_down:2 - :star:21 (Utilities / HTTP Clients)
- awesome-go-with-stars - gpath - Library to simplify access struct fields with Go's expression in reflection. (Reflection / HTTP Clients)
- fucking-awesome-go - gpath - Library to simplify access struct fields with Go's expression in reflection. (Reflection / HTTP Clients)
- awesome-go-cn - gpath
- awesome-go - gpath - Library to simplify access struct fields with Go's expression in reflection. (Reflection / HTTP Clients)
- awesome-go-extra - gpath - 05-24T06:24:18Z|2017-06-04T08:31:39Z| (Utilities / Fail injection)
- awesome-go - gpath - Library to simplify access struct fields with Go's expression in reflection. (Utilities / <span id="高级控制台用户界面-advanced-console-uis">高级控制台用户界面 Advanced Console UIs</span>)
- awesome-go - gpath - Library to simplify access struct fields with Go's expression in reflection. (Utilities / Utility/Miscellaneous)
- awesome-go - gpath - Library to simplify access struct fields with Go's expression in reflection. (Reflection / HTTP Clients)
- awesome-Char - gpath - Library to simplify access struct fields with Go's expression in reflection. (Utilities / HTTP Clients)
- awesome-go-cn - gpath
- awesome-go - gpath - Library to simplify access struct fields with Go's expression in reflection. (Utilities / HTTP Clients)
README
# gpath [][godoc] [][travis] [](https://goreportcard.com/report/github.com/tenntenn/gpath) [](https://codecov.io/gh/tenntenn/gpath)
[godoc]: http://godoc.org/github.com/tenntenn/gpath
[travis]: https://travis-ci.org/tenntenn/gpath
`gpath` is a Go package to access a field by a path using `reflect` pacakge.
A path is represented by a Go's expression such as `A.B.C[0]`.
You can use selector and index expressions into a path.
See usage and example in [GoDoc](https://godoc.org/github.com/tenntenn/gpath).
*NOTE*: This package is experimental and may make backward-incompatible changes.
## Install
Use go get:
```
$ go get github.com/tenntenn/gpath
```
## Usage
All usage are described in [GoDoc](https://godoc.org/github.com/tenntenn/gpath).
[mercari/go-httpdoc](https://github.com/mercari/go-httpdoc) is a good example for gpath.