How to determine the type of a variable or object in Go: a beginner's guide
Hi! I've just started learning Go and I'm having a problem. In other languages, like Python or JavaScript, I can easily check the type of a variable at runtime using type() or typeof. But in Go I can't find a simple way to do this.\n\nHere's an example: I'm writing a function that takes interface{} (empty interface) and should handle different types differently. Let's say I have this code:\n\n```go\npackage main\n\nimport "fmt"\n\nfunc processData(data interface{}) {\n // How do I find out what type data is?\n fmt.Println("Received data:", data)\n}\n\nfunc main() {\n processData(42)\n processData("hello")\n processData([]int{1, 2, 3})\n}\n```\n\nI want the processData function to behave differently: if it's an int — print the number, if it's a string — print its length,