Skip to content

Commit 2ff45fd

Browse files
fix: use tagged switch for staticcheck QF1003 (#87)
Co-authored-by: Ona <no-reply@ona.com>
1 parent 3da4b03 commit 2ff45fd

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

cmd/api_memory.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,9 +159,10 @@ func (m *MemoryAPI) handleSupersede(w http.ResponseWriter, r *http.Request) {
159159
result, err := m.store.Supersede(r.Context(), req)
160160
if err != nil {
161161
code := http.StatusInternalServerError
162-
if err == memory.ErrNotFound {
162+
switch err {
163+
case memory.ErrNotFound:
163164
code = http.StatusNotFound
164-
} else if err == memory.ErrAlreadyExpired {
165+
case memory.ErrAlreadyExpired:
165166
code = http.StatusConflict
166167
}
167168
writeJSONError(w, err.Error(), code)

0 commit comments

Comments
 (0)