Open Issues Need Help
View All on GitHubAI Summary: This issue proposes simplifying the `Can()` method in `router/router.go` by eliminating the `isAllowed` boolean variable. Instead of setting and returning this variable, the method should directly return `true` when a permission is granted and `false` at the end if no permission is found. This change aims to improve code clarity and reduce the line count.
Gadget is a Golang bot for Slack's Events API
AI Summary: This issue reports a gofmt formatting violation in the `router/router.go` file. The fix involves running the `gofmt` command to automatically reformat the file and then committing the changes. This is a straightforward code style correction.
Gadget is a Golang bot for Slack's Events API
AI Summary: The build process attempts to inject version information into the binary using linker flags, but the target `conf` package and its variables do not exist. This means the version is never actually embedded, and the build-time version injection is silently broken. The fix involves creating the `conf` package with the necessary variables and ensuring they are used at runtime.
Gadget is a Golang bot for Slack's Events API
AI Summary: The `testify` dependency is incorrectly marked as indirect in the `go.mod` file, even though it's directly imported by test files. Running `go mod tidy` is suggested as a fix to correct this annotation, ensuring `testify` is properly recognized as a direct dependency.
Gadget is a Golang bot for Slack's Events API
AI Summary: This issue addresses a stylistic inconsistency in the Go codebase where `else` statements are used after `return` statements, which is contrary to Go conventions. The goal is to refactor these instances to adhere to standard Go style, improving code readability without impacting functionality.
Gadget is a Golang bot for Slack's Events API
AI Summary: This issue addresses a minor typo in a comment within the `router/router.go` file. The word "shcemas" should be corrected to "schemas" in a comment related to database setup. This is a straightforward documentation fix.
Gadget is a Golang bot for Slack's Events API
AI Summary: The `user_info` plugin in `plugins/user_info/user_info.go` uses `math/rand` which is not auto-seeded in Go 1.16, leading to deterministic animal selection. This issue proposes replacing `math/rand` with `crypto/rand` for true randomness and consistency with the `core` package, or upgrading Go to 1.22+ to use the auto-seeded `math/rand/v2`.
Gadget is a Golang bot for Slack's Events API
AI Summary: The current implementation returns a 404 status code when an incoming message event does not match any defined channel message routes. This is semantically misleading as the endpoint itself exists. The suggested fix is to return a 200 OK status code to indicate that the event was processed (and ignored) without error, aligning with Slack's behavior for non-actionable events.
Gadget is a Golang bot for Slack's Events API
AI Summary: The `UpdateBotUID` function incorrectly sets the `BotUID` to an empty string when `getBotUidFromBody` encounters a parsing error. This can lead to a fragile state where a previously set `BotUID` might be cleared if subsequent calls fail, even though the early return currently prevents this. The suggested fix is to only assign the `BotUID` when the parsing is successful.
Gadget is a Golang bot for Slack's Events API