fix(*): misc linter issues

pull/1614/head
Adam Reese 8 years ago
parent 190dafbc8e
commit 803475c824

@ -166,7 +166,7 @@ func (p *packageCmd) clearsign(filename string) error {
// promptUser implements provenance.PassphraseFetcher // promptUser implements provenance.PassphraseFetcher
func promptUser(name string) ([]byte, error) { func promptUser(name string) ([]byte, error) {
fmt.Printf("Password for key %q > ", name) fmt.Printf("Password for key %q > ", name)
pw, err := terminal.ReadPassword(int(syscall.Stdin)) pw, err := terminal.ReadPassword(syscall.Stdin)
fmt.Println() fmt.Println()
return []byte(pw), err return pw, err
} }

@ -153,14 +153,12 @@ func set(data map[string]interface{}, key string, val interface{}) {
} }
func (t *parser) val() ([]rune, error) { func (t *parser) val() ([]rune, error) {
v := []rune{}
stop := runeSet([]rune{','}) stop := runeSet([]rune{','})
v, _, err := runesUntil(t.sc, stop) v, _, err := runesUntil(t.sc, stop)
return v, err return v, err
} }
func (t *parser) valList() ([]interface{}, error) { func (t *parser) valList() ([]interface{}, error) {
r, _, e := t.sc.ReadRune() r, _, e := t.sc.ReadRune()
if e != nil { if e != nil {
return []interface{}{}, e return []interface{}{}, e
@ -193,7 +191,7 @@ func (t *parser) valList() ([]interface{}, error) {
} }
} }
func runesUntil(in *bytes.Buffer, stop map[rune]bool) ([]rune, rune, error) { func runesUntil(in io.RuneReader, stop map[rune]bool) ([]rune, rune, error) {
v := []rune{} v := []rune{}
for { for {
switch r, _, e := in.ReadRune(); { switch r, _, e := in.ReadRune(); {

@ -443,7 +443,7 @@ func getCurrentObject(target *resource.Info, infos []*resource.Info) (runtime.Ob
if found, ok := findMatchingInfo(target, infos); ok { if found, ok := findMatchingInfo(target, infos); ok {
return found.Mapping.ConvertToVersion(found.Object, found.Mapping.GroupVersionKind.GroupVersion()) return found.Mapping.ConvertToVersion(found.Object, found.Mapping.GroupVersionKind.GroupVersion())
} }
return nil, fmt.Errorf("No resource with the name %s found.", target.Name) return nil, fmt.Errorf("no resource with the name %s found", target.Name)
} }
// isMatchingInfo returns true if infos match on Name and Kind. // isMatchingInfo returns true if infos match on Name and Kind.

@ -96,7 +96,7 @@ func (t *Tunnel) ForwardPort() error {
select { select {
case err = <-errChan: case err = <-errChan:
return fmt.Errorf("Error forwarding ports: %v\n", err) return fmt.Errorf("forwarding ports: %v", err)
case <-pf.Ready: case <-pf.Ready:
return nil return nil
} }

Loading…
Cancel
Save