Avatar ·

How to print struct contents to console in Go?

Hi everyone! I just started learning Go and I'm having a debugging problem. I created a `User` struct with fields `Name`, `Age`, and `Email`. When I try to print it to the console using `fmt.Println(user)`, I see something like `{John 30 john@example.com}`, but it's not very readable. Especially when the struct is large or has nested structs. Here's my code: ```go package main import "fmt" type Address struct { City string Street string ZipCode int } type User struct { Name string Age int Email string Address Address } func main() { user := User{ Name: "John Doe", Age: 30, Email: "john@example.com", Address: Address{ City: "New York", Street: " ```