Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(281)

Unified Diff: client/internal/common/utils.go

Issue 1135173003: Create packages client/internal/ retry and lhttp. (Closed) Base URL: git@github.com:luci/luci-go@3_UI
Patch Set: . Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: client/internal/common/utils.go
diff --git a/client/internal/common/utils.go b/client/internal/common/utils.go
index 08444498970c93d2885800bc39850c8a4fd04d0d..8aeaea646415770c7fb17c7357916d9325a7dbed 100644
--- a/client/internal/common/utils.go
+++ b/client/internal/common/utils.go
@@ -5,13 +5,10 @@
package common
import (
- "errors"
"fmt"
"io"
- "net/url"
"os"
"runtime"
- "strings"
"time"
"github.com/luci/luci-go/client/internal/imported"
@@ -44,24 +41,6 @@ func SizeToString(s int64) string {
return fmt.Sprintf("%.2f%s", v, units[i])
}
-// URLToHTTPS ensures the url is https://.
-func URLToHTTPS(s string) (string, error) {
- u, err := url.Parse(s)
- if err != nil {
- return "", err
- }
- if u.Scheme != "" && u.Scheme != "https" {
- return "", errors.New("Only https:// scheme is accepted. It can be omitted.")
- }
- if !strings.HasPrefix(s, "https://") {
- s = "https://" + s
- }
- if _, err = url.Parse(s); err != nil {
- return "", err
- }
- return s, nil
-}
-
// IsDirectory returns true if path is a directory and is accessible.
func IsDirectory(path string) bool {
fileInfo, err := os.Stat(path)

Powered by Google App Engine
This is Rietveld 408576698