Browse Source

Linting tabComplete for future Travis checks

pull/26/head
Gregory Rudolph 5 years ago
parent
commit
20a687208a
Signed by: rudi
GPG Key ID: EF64F3CBD1A1EBDD
  1. 11
      tabComplete.go

11
tabComplete.go

@ -20,7 +20,7 @@ func handleTab(viewName string) error {
inputString, err := getInputString(viewName) inputString, err := getInputString(viewName)
if err != nil { if err != nil {
return err return err
} else { }
// if you successfully get an input string, grab the last word from the string // if you successfully get an input string, grab the last word from the string
ss := regexp.MustCompile(`[ #]`).Split(inputString, -1) ss := regexp.MustCompile(`[ #]`).Split(inputString, -1)
s := ss[len(ss)-1] s := ss[len(ss)-1]
@ -59,7 +59,7 @@ func handleTab(viewName string) error {
writeToView(viewName, remainder) writeToView(viewName, remainder)
} }
} }
}
return nil return nil
} }
@ -123,9 +123,10 @@ func getCurrentChannelMembership() []string {
var rs []string var rs []string
if channel.Name != "" { if channel.Name != "" {
t := k.NewTeam(channel.Name) t := k.NewTeam(channel.Name)
if testVar, err := t.MemberList(); err != nil { testVar, err := t.MemberList()
if err != nil {
return rs // then this isn't a team, its a PM or there was an error in the API call return rs // then this isn't a team, its a PM or there was an error in the API call
} else { }
for _, m := range testVar.Result.Members.Owners { for _, m := range testVar.Result.Members.Owners {
rs = append(rs, fmt.Sprintf("%+v", m.Username)) rs = append(rs, fmt.Sprintf("%+v", m.Username))
} }
@ -138,7 +139,7 @@ func getCurrentChannelMembership() []string {
for _, m := range testVar.Result.Members.Readers { for _, m := range testVar.Result.Members.Readers {
rs = append(rs, fmt.Sprintf("%+v", m.Username)) rs = append(rs, fmt.Sprintf("%+v", m.Username))
} }
}
} }
return rs return rs
} }

Loading…
Cancel
Save