Method of file operation in golang