check / check (push) Waiting to run
The shared files are fetched from sneak/prompts dd4027b, with this repository's own entries after the shared content in .gitignore, .editorconfig and .dockerignore. Lint and tests are Dockerfile phases (golangci-lint v2.14.0, Debian Go 1.24.13) that the build stage depends on, and the Makefile targets call the script/ entrypoints. make fmt also formats Markdown with prettier. Fixes for the new lint findings: the auth cookie is always Secure, an IRC connection's relay goroutine stops when the connection closes, and repeated strings are constants. neoirc-cli treats a plain-HTTP server on localhost or a loopback address as secure, so local use keeps its session. Whether the 60-second test cap covers building the test phase is open on sneak/prompts issue 113. Model: opus-5-5
20 lines
374 B
Go
20 lines
374 B
Go
package db
|
|
|
|
import (
|
|
"errors"
|
|
|
|
"modernc.org/sqlite"
|
|
sqlite3 "modernc.org/sqlite/lib"
|
|
)
|
|
|
|
// IsUniqueConstraintError reports whether err is a SQLite
|
|
// unique-constraint violation.
|
|
func IsUniqueConstraintError(err error) bool {
|
|
var sqliteErr *sqlite.Error
|
|
if !errors.As(err, &sqliteErr) {
|
|
return false
|
|
}
|
|
|
|
return sqliteErr.Code() == sqlite3.SQLITE_CONSTRAINT_UNIQUE
|
|
}
|