pre-commit: add configuration and did some cleanup

Signed-off-by: Sumner Evans <sumner@beeper.com>
This commit is contained in:
Sumner Evans
2022-10-21 09:35:03 -05:00
parent f2df6e517b
commit 07d2cae5b2
18 changed files with 73 additions and 77 deletions

View File

@ -1,28 +0,0 @@
package types
import (
"database/sql/driver"
"maunium.net/go/mautrix/id"
)
type ContentURI struct {
id.ContentURI
}
func (m *ContentURI) Scan(value interface{}) error {
bytes, ok := value.([]byte)
if !ok {
//return errors.New(fmt.Sprint("Failed to unmarshal value:", value))
}
if len(bytes) == 0 {
uri, _ := id.ParseContentURI("")
*m = ContentURI{uri}
return nil
}
return m.UnmarshalText(bytes)
}
func (m ContentURI) Value() (driver.Value, error) {
return m.String(), nil
}