Why?
The first programming language I’ve learnt is PHP and I love it today though I don’t write it so frequently.
The most charming part of PHP is the design of array. It combines the concept of dict list in Python, someone would say it’s not so clear but a man who has writen PHP for a long time would say that’s a fucking good design.
Recently I’ve fallen in love with Golang because of its simplicity and readability. But there would be some awful times when it comes to retriet a value from a map. This project is designed for this.
Usage
|
|
What problems does it solve
Imagine you’ve got a complex structure like this
|
|
How can you check if the first projects second task is completed?
|
|
Too complicated? What if you do not want define the structs in advance?
|
|
Holy shit! Too many template code. Now do you miss the PHP way?
|
|
In PHP you don’t have to check the validatbility of every level and you can use isset
to check only the target key.
In golang operators are not allowed to be overrided, so we can use variant variables.
Examples
See the *_test.go
files.