slongfield / pyfmt Goto Github PK
View Code? Open in Web Editor NEWGolang implementation of PEP3101
License: BSD 3-Clause "New" or "Revised" License
Golang implementation of PEP3101
License: BSD 3-Clause "New" or "Revised" License
Hey good job, this looks great.
I've been playing with the getElement function, Not sure if this is even a bug but I wanted your comments.
What I'm trying to do is access foo.bar.someStruct.someProp, usually from a slice of structs but for today from a map[string]interface{}.
I cant access anything with & somestruct{...}
, with no ampersend its fine
type b struct {
Bazzer int
Bazzle []int
}
func main() {
a := map[string]interface{} {
"bar" : map[string]interface{} {
"baz": &b{0,[]int{1,2,3}},
"buzz": []int{1,2,3} },
"baz" : []int{1,2,3},
"bazzle": []string{"1","2","3"} }
b,err := getElement("bar.baz.Bazzle[0]",0,a)
fmt.Println(b,err)
}
Expected output: one of the struct members,
Actual output: attempted to get item by name in non-struct, non-map
If I drop the &
before the struct &b {...}
it works fine.
thoughts?
sorry if not a bug, I noticed this while I was just giving a quick evaluation of whether the software if it will work for my purposes. Cheers it looks great.
Hi @slongfield
We are considering using pyfmt with gpython to add .format
support. Is this something you'd be interested in helping support or at least bless? Your efforts and support would be welcome but the ask would be for you to consider merging any minor PRs to pyfmt
that make good sense. I think pyfmt
is perfect for gpython!
Best,
Drew
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.