Closed jeggy closed 5 years ago
Since objx is mostly used for dealing with JSON data, why do you think this change is needed? It adds a lot more complexity and a much bigger API to the library. I'm not sure if i'm willing to maintain this.
That's true. I'm not using this with json data, but I'm using it with the flag library.
Sample:
import (
"flag"
"github.com/stretchr/objx"
)
func main() {
clis := objx.Map {
"message": flag.String("m","default","The message to log out"),
}
flag.Parse()
print("Message: ", *clis.Get("message").PointerStr())
}
I see that you use case makes sense. But my point still stands: This adds a lot of complexity and I don't want to maintain this. If you provided a PR which introduces this change over the entire codebase, I would merge it. But this is just a fraction of the changes needed to fully support pointers.
No problem. I haven't really looked through the whole project. I just added whatever I needed and created a pull request.
Summary
Added support for retrieving pointer values.
Checklist
task test
task lint