-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Yeah, check err if its null then defer, otherwise I don't think you
should.

On 02/13/2014 03:57 PM, jaked122 wrote:
> In src/disk/filesystem.go:
> 
>> +} + +func  CreateSwarmSystem(swarmid string)
>> (*SwarmStorage,error){ +	var i SwarmStorage +	i.SwarmId =
>> swarmid +	i.amountused=0 +
>> err:=os.Mkdir(swarmid,os.ModeDir|os.ModePerm) +	if
>> err!=nil&&!os.IsExist(err){ +		return nil,err +	} +	return
>> &i,nil +} + +func (r SwarmStorage) CreateFile(filehash string,
>> length uint64) error{ +
>> file,err:=os.Create(r.SwarmId+string(os.PathSeparator)+filehash) 
>> +	defer file.Close()
> 
> Do you mean the defer file.Close()?
> 
> — Reply to this email directly or view it on GitHub 
> <https://github.com/Siacoin/Sia/pull/4/files#r9727065>.
> 

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.22 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBAgAGBQJS/TKOAAoJEHP1nN3uZoHuIlcH/jL7f2WFHIERk2lLjb/fGCqC
Md3roCVS6O/rRJytM5O0/tJXvsKIuV+2XvrK2Tu7l0Pgb6Kx/1qKO5VfPmw1hrmz
ao2TY07utJIz6ZjTn771ifOp7T86fLVFZDxTMwqRaBZmMOEw9D7aMIPxvAPtjMmM
Rh9PBkLbolYUNNDOVIsJzze0eIuR1E9JxvaAlDWpQ0W2bjB3KmoE3Nn4JqGgcGql
ojxxRtVmxmao577xKZPbzVy+RIWUCwLE48mzuOzYCY4jdaCRbN/7MTHntTvsEcoz
gqBa91dvS4AesqK7upA4l8kZnBmU5XgBwhSdIWUrISty6WimYAqXPfStgj+jATU=
=aivI
-----END PGP SIGNATURE-----