1
0
mirror of https://github.com/minio/mc.git synced 2025-11-13 12:22:45 +03:00

Removing more dead code

This commit is contained in:
Frederick F. Kautz IV
2015-04-09 20:35:33 -07:00
parent 8e5c524a9d
commit 31e9f50333
4 changed files with 7 additions and 24 deletions

View File

@@ -33,7 +33,7 @@ func Comma(v int64) string {
j--
}
parts[j] = strconv.Itoa(int(v))
return sign + strings.Join(parts[j:len(parts)], ",")
return sign + strings.Join(parts[j:], ",")
}
// Commaf produces a string form of the given number in base 10 with
@@ -97,5 +97,5 @@ func BigComma(b *big.Int) string {
j--
}
parts[j] = strconv.Itoa(int(b.Int64()))
return sign + strings.Join(parts[j:len(parts)], ",")
return sign + strings.Join(parts[j:], ",")
}

View File

@@ -308,7 +308,7 @@ func (cw *ansiColorWriter) Write(p []byte) (int, error) {
}
if cw.state == outsideCsiCode {
nw, err = cw.w.Write(p[first:len(p)])
nw, err = cw.w.Write(p[first:])
}
return r + nw + nc, err

View File

@@ -19,8 +19,9 @@ package main
import "errors"
var (
// TODO remove, unused
// fs
errFskey = errors.New("Key is needed to get the file")
// errFskey = errors.New("Key is needed to get the file")
// url
errEmptyURL = errors.New("URL is empty")
@@ -31,8 +32,9 @@ var (
// url
errInvalidURL = errors.New("Invalid URL")
// TODO remove, unused
// host
errHostname = errors.New("No hostname specified")
// errHostname = errors.New("No hostname specified")
// common
errInvalidbucket = errors.New("Invalid bucket name")

View File

@@ -105,25 +105,6 @@ func fixFileURL(urlStr string) (fixedURL string, err error) {
}
// url2Host extracts hostname from the URL.
func url2Host(urlStr string) (host string, err error) {
if urlStr == "" {
return "", iodine.New(errEmptyURL, nil)
}
utype, e := getURLType(urlStr)
if e != nil || utype != urlFile {
return "", iodine.New(e, nil)
}
u, e := url.Parse(urlStr)
if e != nil {
return "", iodine.New(e, nil)
}
return u.Host, nil
}
// url2Object converts URL to bucket and objectname
func url2Object(urlStr string) (bucketName, objectName string, err error) {
u, err := url.Parse(urlStr)