That “file=@filename” notation is specific to curl. In Go, you might need to handle reading the data yourself. I think this will do it (or at least, get you started):
However, I still have a question about this. Does io.Copy actually copy the file’s content to the computer’s RAM? If it does, could there be a better way to upload large files?
This depends on the implementations of the involved buffers.
Though implementations usually strive to be implemented in a way that they don’t need to hold full content in memory, unless reading/writing directly from/to memory.