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

Side by Side Diff: client/cmd/isolated/common.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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 package main 5 package main
6 6
7 import ( 7 import (
8 "errors" 8 "errors"
9 "io" 9 "io"
10 "io/ioutil" 10 "io/ioutil"
11 "log" 11 "log"
12 "os" 12 "os"
13 13
14 » "github.com/luci/luci-go/client/internal/common" 14 » "github.com/luci/luci-go/client/internal/lhttp"
15 "github.com/luci/luci-go/client/internal/tracer" 15 "github.com/luci/luci-go/client/internal/tracer"
16 "github.com/maruel/subcommands" 16 "github.com/maruel/subcommands"
17 ) 17 )
18 18
19 type commonFlags struct { 19 type commonFlags struct {
20 quiet bool 20 quiet bool
21 verbose bool 21 verbose bool
22 tracePath string 22 tracePath string
23 traceFile io.Closer 23 traceFile io.Closer
24 } 24 }
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 func (c *commonServerFlags) Init(b *subcommands.CommandRunBase) { 72 func (c *commonServerFlags) Init(b *subcommands.CommandRunBase) {
73 b.Flags.StringVar(&c.serverURL, "isolate-server", "", "Isolate server to use") 73 b.Flags.StringVar(&c.serverURL, "isolate-server", "", "Isolate server to use")
74 b.Flags.StringVar(&c.serverURL, "I", "", "Alias for -isolate-server") 74 b.Flags.StringVar(&c.serverURL, "I", "", "Alias for -isolate-server")
75 b.Flags.StringVar(&c.namespace, "namespace", "default-gzip", "") 75 b.Flags.StringVar(&c.namespace, "namespace", "default-gzip", "")
76 } 76 }
77 77
78 func (c *commonServerFlags) Parse() error { 78 func (c *commonServerFlags) Parse() error {
79 if c.serverURL == "" { 79 if c.serverURL == "" {
80 return errors.New("-isolate-server must be specified") 80 return errors.New("-isolate-server must be specified")
81 } 81 }
82 » if s, err := common.URLToHTTPS(c.serverURL); err != nil { 82 » if s, err := lhttp.URLToHTTPS(c.serverURL); err != nil {
83 return err 83 return err
84 } else { 84 } else {
85 c.serverURL = s 85 c.serverURL = s
86 } 86 }
87 if c.namespace == "" { 87 if c.namespace == "" {
88 return errors.New("-namespace must be specified.") 88 return errors.New("-namespace must be specified.")
89 } 89 }
90 return nil 90 return nil
91 } 91 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698