Memos is an open-source, self-hosted note-taking app that brings your everyday thoughts together in a personal timeline. Your data stays yours, and you choose what to keep private or share.
Go dockerfossgomarkdownmemomicroblognote-takingnotesopen-sourceown-your-datareactself-hostedsqlitetimeline
package mysql
import (
"errors"
"testing"
"github.com/stretchr/testify/require"
"github.com/usememos/memos/store"
)
type failingMySQLSpaceSummaryRow struct {
err error
}
func (row failingMySQLSpaceSummaryRow) Scan(...any) error {
return row.err
}
func TestScanMySQLSpaceSummaryWrapsErrors(t *testing.T) {
cause := errors.New("scan failed")
err := scanMySQLSpaceSummary(failingMySQLSpaceSummaryRow{err: cause}, &store.Space{})
require.ErrorIs(t, err, cause)
require.ErrorContains(t, err, "failed to populate MySQL space summary")
}