Skip to content

fix : upload-file

David J Peacock requested to merge aki237:upload-fix into master

Created by: aki237

detailed : before refactoring (commit : 4f41de52), the body was a global variable (io.Reader). So the scope of that variable was till the end of the program. But after refactoring the body was moved to a function as a local variable and passed around like a reference (which is not possible in Go for interfaces). So the body variable will stay as nil and no content is uploaded at all. Now the functions where the body was passed were rewrote so that they return a io.Reader and can be stored locally in that function itself.

Merge request reports