Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a function in Go to print all the current member names and values of an object?

Tags:

go

I'm looking for something like PHP's print_r or python's dict. Anybody know if this function exists, or its something that needs to be implemented?

like image 724
fuentesjr Avatar asked Nov 19 '25 09:11

fuentesjr


1 Answers

There is a reflect package in go.
You can find solution to your problem in the following article.

like image 72
Li0liQ Avatar answered Nov 21 '25 21:11

Li0liQ



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!