I'm learning Golang and I can't understand this API design. So lots of os package methods return pointer to a *File. My question is why is it a pointer and not just a value if File embeds pointer to a package scoped *file? Isn't it the same logic as for slices or maps? I mean, if its underlying structure is just a pointer to a "real" file object why can't I just pass it around as value? As I understand I would just copy File but underlying file won't be copied, only its pointer.
Thank you in advance.