Skip to content

Commit

Permalink
Fix lint issues (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
robinschneider committed Jul 20, 2023
1 parent 2d4a5e9 commit 6233d4c
Showing 1 changed file with 1 addition and 16 deletions.
17 changes: 1 addition & 16 deletions prow/rocketchat/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,17 +66,11 @@ type Client struct {
// If logger is non-nil, log all method calls with it.
logger Logger

tokenGenerator func() []byte
fake bool
fake bool

webhookURL string
}

const (
botName = "prow"
botIconEmoji = ":prow:"
)

// NewClient creates a RocketChat client with an API token.
func NewClient(webhook func() []byte) *Client {
webhookURL := string(webhook())
Expand Down Expand Up @@ -104,14 +98,6 @@ func (sl *Client) log(methodName string, args ...interface{}) {
sl.logger.Debugf("%s(%s)", methodName, strings.Join(as, ", "))
}

func (sl *Client) urlValues() *url.Values {
uv := url.Values{}
uv.Add("username", botName)
uv.Add("icon_emoji", botIconEmoji)
uv.Add("token", string(sl.tokenGenerator()))
return &uv
}

func (sl *Client) postMessage(url string, uv *url.Values) error {
resp, err := http.PostForm(url, *uv)
if err != nil {
Expand Down Expand Up @@ -143,7 +129,6 @@ func (sl *Client) WriteMessage(text, channel string) error {
return nil
}

//var uv = sl.urlValues()
uv := url.Values{}
if channel != "" {
uv.Add("channel", channel)
Expand Down

0 comments on commit 6233d4c

Please sign in to comment.