Skip to content

Commit

Permalink
linting
Browse files Browse the repository at this point in the history
  • Loading branch information
Dschoordsch committed Dec 19, 2024
1 parent 0d71b09 commit a3fadfb
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 10 deletions.
5 changes: 2 additions & 3 deletions server/command_hooks.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ import (
)

const (
commandTrigger = "parabol"
commandTrigger = "parabol"
commandDescription = "Start a Parabol Activity."
commandHelpTitle = "###### Parabol Slash Command Help"
commandHelpTitle = "###### Parabol Slash Command Help"
)

func (p *Plugin) registerCommands() error {
Expand Down Expand Up @@ -270,4 +270,3 @@ func getDialogWithSampleElements() model.Dialog {
dialog.IntroductionText = "**Some** _introductory_ paragraph in Markdown formatted text with [link](https://mattermost.com)"
return dialog
}

6 changes: 2 additions & 4 deletions server/configuration.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package main

import (
"fmt"
"net/http"

"github.com/pkg/errors"
Expand Down Expand Up @@ -88,12 +87,11 @@ func (p *Plugin) loadCommands() error {
return errors.Wrap(err, "failed to connect to Parabol")
}

defer res.Body.Close()
var commands []SlashCommand
if err := getJSON(res.Body, &commands); err != nil {
return errors.Wrap(err, "failed to parse Parabol response")
}
p.commands = commands
p.registerCommands()

return nil
return p.registerCommands()
}
4 changes: 1 addition & 3 deletions server/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const (
)

type SlashCommand struct {
Trigger string `json:"trigger"`
Trigger string `json:"trigger"`
Description string `json:"description"`
}

Expand All @@ -40,7 +40,6 @@ type Plugin struct {
configuration *configuration

commands []SlashCommand

}

type Context struct {
Expand Down Expand Up @@ -340,7 +339,6 @@ func (p *Plugin) connect(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(http.StatusOK)
}


func (p *Plugin) ServeHTTP(c *plugin.Context, w http.ResponseWriter, r *http.Request) {
mux := http.NewServeMux()
mux.HandleFunc("POST /notify/{teamID}", p.fixedPath(p.notify))
Expand Down

0 comments on commit a3fadfb

Please sign in to comment.