diff options
| author | Chris Lu <chris.lu@gmail.com> | 2013-09-01 23:58:21 -0700 |
|---|---|---|
| committer | Chris Lu <chris.lu@gmail.com> | 2013-09-01 23:58:21 -0700 |
| commit | 82b74c7940d958c4244cbc67d495b8156a17d2b3 (patch) | |
| tree | 69c0fcee0f49e027a1f2bc0c9d012b2e4328475a /go/operation | |
| parent | 2e70cc8be77d0047139ea56864df74477387f2f3 (diff) | |
| download | seaweedfs-82b74c7940d958c4244cbc67d495b8156a17d2b3.tar.xz seaweedfs-82b74c7940d958c4244cbc67d495b8156a17d2b3.zip | |
issue 43 "go fmt" chagnes from "Ryan S. Brown" <sb@ryansb.com>
some basic changes to parse upload url
Diffstat (limited to 'go/operation')
| -rw-r--r-- | go/operation/delete_content.go | 10 | ||||
| -rw-r--r-- | go/operation/submit.go | 4 |
2 files changed, 7 insertions, 7 deletions
diff --git a/go/operation/delete_content.go b/go/operation/delete_content.go index 8f8ea58f3..f14259ee6 100644 --- a/go/operation/delete_content.go +++ b/go/operation/delete_content.go @@ -6,19 +6,19 @@ import ( "net/http" ) -func DeleteFile(server string, fileId string) (error) { +func DeleteFile(server string, fileId string) error { fid, parseErr := storage.ParseFileId(fileId) if parseErr != nil { return parseErr } - lookup, lookupError := Lookup(server,fid.VolumeId) + lookup, lookupError := Lookup(server, fid.VolumeId) if lookupError != nil { - return lookupError + return lookupError } if len(lookup.Locations) == 0 { - return nil + return nil } - return Delete("http://"+lookup.Locations[0].PublicUrl+"/"+fileId) + return Delete("http://" + lookup.Locations[0].PublicUrl + "/" + fileId) } func Delete(url string) error { req, err := http.NewRequest("DELETE", url, nil) diff --git a/go/operation/submit.go b/go/operation/submit.go index e0001e60b..d24a89b2b 100644 --- a/go/operation/submit.go +++ b/go/operation/submit.go @@ -95,8 +95,8 @@ func (fi FilePart) Upload(server string, fid string) (int, error) { if fi.ModTime != 0 { fileUrl += "?ts=" + strconv.Itoa(int(fi.ModTime)) } - if closer, ok := fi.Reader.(io.Closer); ok{ - defer closer.Close() + if closer, ok := fi.Reader.(io.Closer); ok { + defer closer.Close() } ret, e := Upload(fileUrl, fi.FileName, fi.Reader, fi.IsGzipped, fi.MimeType) if e != nil { |
