Fix lint issues

This commit is contained in:
Neil Alexander 2020-05-01 13:15:27 +01:00
parent 08878c59b2
commit 46440d3f6d
3 changed files with 4 additions and 7 deletions

View File

@ -55,10 +55,7 @@ func (e HTTPError) Error() string {
// BuildURL builds a URL with the Client's homserver/prefix/access_token set already. // BuildURL builds a URL with the Client's homserver/prefix/access_token set already.
func (cli *Client) BuildURL(urlPath ...string) string { func (cli *Client) BuildURL(urlPath ...string) string {
ps := []string{cli.Prefix} ps := append([]string{cli.Prefix}, urlPath...)
for _, p := range urlPath {
ps = append(ps, p)
}
return cli.BuildBaseURL(ps...) return cli.BuildBaseURL(ps...)
} }

View File

@ -46,7 +46,7 @@ func Example_customInterfaces() {
cli.Client = http.DefaultClient cli.Client = http.DefaultClient
// Once you call a function, you can't safely change the interfaces. // Once you call a function, you can't safely change the interfaces.
cli.SendText("!foo:bar", "Down the rabbit hole") _, _ = cli.SendText("!foo:bar", "Down the rabbit hole")
} }
func ExampleClient_BuildURLWithQuery() { func ExampleClient_BuildURLWithQuery() {

View File

@ -31,8 +31,8 @@ func (room Room) UpdateState(event *Event) {
// GetStateEvent returns the state event for the given type/state_key combo, or nil. // GetStateEvent returns the state event for the given type/state_key combo, or nil.
func (room Room) GetStateEvent(eventType string, stateKey string) *Event { func (room Room) GetStateEvent(eventType string, stateKey string) *Event {
stateEventMap, _ := room.State[eventType] stateEventMap := room.State[eventType]
event, _ := stateEventMap[stateKey] event := stateEventMap[stateKey]
return event return event
} }