Commit 914dbe8b authored by Adam Reese's avatar Adam Reese Committed by GitHub

Merge pull request #1614 from adamreese/fix/linter-issues

fix(*): misc linter issues
parents 69a95f32 803475c8
......@@ -166,7 +166,7 @@ func (p *packageCmd) clearsign(filename string) error {
// promptUser implements provenance.PassphraseFetcher
func promptUser(name string) ([]byte, error) {
fmt.Printf("Password for key %q > ", name)
pw, err := terminal.ReadPassword(int(syscall.Stdin))
pw, err := terminal.ReadPassword(syscall.Stdin)
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) {
v := []rune{}
stop := runeSet([]rune{','})
v, _, err := runesUntil(t.sc, stop)
return v, err
}
func (t *parser) valList() ([]interface{}, error) {
r, _, e := t.sc.ReadRune()
if e != nil {
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{}
for {
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 {
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.
......
......@@ -96,7 +96,7 @@ func (t *Tunnel) ForwardPort() error {
select {
case err = <-errChan:
return fmt.Errorf("Error forwarding ports: %v\n", err)
return fmt.Errorf("forwarding ports: %v", err)
case <-pf.Ready:
return nil
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment