diff options
author | Tulir Asokan <tulir@maunium.net> | 2018-04-22 20:13:57 +0300 |
---|---|---|
committer | Tulir Asokan <tulir@maunium.net> | 2018-04-22 20:14:40 +0300 |
commit | 7e946a07035caae6fd1622d588abc7872a3a8158 (patch) | |
tree | 4feed08d55cb096a8caaa5800b00e54922f4e279 | |
parent | adee1ffcc414a2efbf36cc1a2ab6061714468588 (diff) |
Fix golint warnings
-rw-r--r-- | config/config.go | 5 | ||||
-rw-r--r-- | ui/messages/message.go | 2 | ||||
-rw-r--r-- | ui/messages/parser/htmltagarray.go | 4 | ||||
-rw-r--r-- | ui/room-view.go | 8 |
4 files changed, 9 insertions, 10 deletions
diff --git a/config/config.go b/config/config.go index 55601df..e11b17a 100644 --- a/config/config.go +++ b/config/config.go @@ -66,10 +66,9 @@ func (config *Config) Load() { os.MkdirAll(config.HistoryDir, 0700) os.MkdirAll(config.MediaDir, 0700) return - } else { - fmt.Println("Failed to read config from", configPath) - panic(err) } + fmt.Println("Failed to read config from", configPath) + panic(err) } err = yaml.Unmarshal(data, &config) diff --git a/ui/messages/message.go b/ui/messages/message.go index d3f2db4..637e8eb 100644 --- a/ui/messages/message.go +++ b/ui/messages/message.go @@ -21,7 +21,7 @@ import ( "maunium.net/go/gomuks/ui/messages/tstring" ) -// Message is a wrapper for the content and metadata of a Matrix message intended to be displayed. +// UIMessage is a wrapper for the content and metadata of a Matrix message intended to be displayed. type UIMessage interface { ifc.Message diff --git a/ui/messages/parser/htmltagarray.go b/ui/messages/parser/htmltagarray.go index d66d7d9..464caa9 100644 --- a/ui/messages/parser/htmltagarray.go +++ b/ui/messages/parser/htmltagarray.go @@ -35,7 +35,7 @@ func (ta *TagArray) Push(tag string) { ta.PushMeta(&TagWithMeta{Tag: tag}) } -// Push adds the given tag to the array. +// PushMeta adds the given tag to the array. func (ta *TagArray) PushMeta(tag *TagWithMeta) { *ta = append(*ta, BlankTag) copy((*ta)[1:], *ta) @@ -78,7 +78,7 @@ func (ta *TagArray) Get(tag string) *TagWithMeta { return ta.GetAfter(tag, -1) } -// IndexAfter returns the first occurrence of the given tag, or nil if the given +// GetAfter returns the first occurrence of the given tag, or nil if the given // tag is not on the list after the given index. func (ta *TagArray) GetAfter(tag string, after int) *TagWithMeta { for i := after + 1; i < len(*ta); i++ { diff --git a/ui/room-view.go b/ui/room-view.go index a66b0ee..bfcb547 100644 --- a/ui/room-view.go +++ b/ui/room-view.go @@ -241,7 +241,7 @@ type completion struct { id string } -func (view *RoomView) AutocompleteUser(existingText string) (completions []completion) { +func (view *RoomView) autocompleteUser(existingText string) (completions []completion) { textWithoutPrefix := strings.TrimPrefix(existingText, "@") for _, user := range view.Room.GetMembers() { if user.DisplayName == textWithoutPrefix || user.UserID == existingText { @@ -256,7 +256,7 @@ func (view *RoomView) AutocompleteUser(existingText string) (completions []compl return } -func (view *RoomView) AutocompleteRoom(existingText string) (completions []completion) { +func (view *RoomView) autocompleteRoom(existingText string) (completions []completion) { // TODO - This was harder than I expected. return []completion{} @@ -270,8 +270,8 @@ func (view *RoomView) InputTabComplete(text string, cursorOffset int) { var strCompletions []string var strCompletion string - completions := view.AutocompleteUser(word) - completions = append(completions, view.AutocompleteRoom(word)...) + completions := view.autocompleteUser(word) + completions = append(completions, view.autocompleteRoom(word)...) if len(completions) == 1 { completion := completions[0] |