Skip to content

Commit b2d8ae3

Browse files
Copilotfiftin
andcommitted
Fix missing return statement in appMiddleware and function call args in setup.go
Co-authored-by: fiftin <[email protected]>
1 parent 16c3089 commit b2d8ae3

File tree

4 files changed

+7
-2
lines changed

4 files changed

+7
-2
lines changed

api/apps.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ func appMiddleware(next http.Handler) http.Handler {
2222
appID, err := helpers.GetStrParam("app_id", w, r)
2323
if err != nil {
2424
helpers.WriteErrorStatus(w, err.Error(), http.StatusBadRequest)
25+
return
2526
}
2627

2728
if err := validateAppID(appID); err != nil {

api/public/.gitkeep

Whitespace-only changes.

cli/setup/setup.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,8 @@ func askValue(prompt string, defaultValue string, item any) {
296296

297297
_, _ = fmt.Sscanln(defaultValue, item)
298298

299-
scanErrorChecker(fmt.Scanln(item))
299+
n, err := fmt.Scanln(item)
300+
scanErrorChecker(n, err)
300301

301302
// Empty line after prompt
302303
fmt.Println("")
@@ -312,7 +313,8 @@ func askConfirmation(prompt string, defaultValue bool, item *bool) {
312313

313314
var answer string
314315

315-
scanErrorChecker(fmt.Scanln(&answer))
316+
n, err := fmt.Scanln(&answer)
317+
scanErrorChecker(n, err)
316318

317319
switch strings.ToLower(answer) {
318320
case "y", "yes":

db/factory/store.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,6 @@ func CreateStore() db.Store {
2424
default:
2525
panic("Unsupported database dialect: " + config.Dialect)
2626
}
27+
// This line should never be reached due to panic above, but satisfies linter
28+
return nil
2729
}

0 commit comments

Comments
 (0)