Skip to content

Commit

Permalink
Merge pull request #31 from Icinga/types-receivers
Browse files Browse the repository at this point in the history
types.*: assert interface compliance not stricter than needed
  • Loading branch information
julianbrost authored Jul 25, 2024
2 parents 9cd1979 + eaf48c9 commit 72ab1a1
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 10 deletions.
8 changes: 4 additions & 4 deletions types/binary.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,11 +115,11 @@ func (binary Binary) Value() (driver.Value, error) {

// Assert interface compliance.
var (
_ fmt.Stringer = (*Binary)(nil)
_ encoding.TextMarshaler = (*Binary)(nil)
_ fmt.Stringer = Binary{}
_ encoding.TextMarshaler = Binary{}
_ encoding.TextUnmarshaler = (*Binary)(nil)
_ json.Marshaler = (*Binary)(nil)
_ json.Marshaler = Binary{}
_ json.Unmarshaler = (*Binary)(nil)
_ sql.Scanner = (*Binary)(nil)
_ driver.Valuer = (*Binary)(nil)
_ driver.Valuer = Binary{}
)
4 changes: 2 additions & 2 deletions types/bool.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,9 @@ func (b Bool) Value() (driver.Value, error) {

// Assert interface compliance.
var (
_ json.Marshaler = (*Bool)(nil)
_ json.Marshaler = Bool{}
_ encoding.TextUnmarshaler = (*Bool)(nil)
_ json.Unmarshaler = (*Bool)(nil)
_ sql.Scanner = (*Bool)(nil)
_ driver.Valuer = (*Bool)(nil)
_ driver.Valuer = Bool{}
)
6 changes: 3 additions & 3 deletions types/unix_milli.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,10 @@ func (t *UnixMilli) fromByteString(data []byte) error {

// Assert interface compliance.
var (
_ encoding.TextMarshaler = (*UnixMilli)(nil)
_ encoding.TextMarshaler = UnixMilli{}
_ encoding.TextUnmarshaler = (*UnixMilli)(nil)
_ json.Marshaler = (*UnixMilli)(nil)
_ json.Marshaler = UnixMilli{}
_ json.Unmarshaler = (*UnixMilli)(nil)
_ driver.Valuer = (*UnixMilli)(nil)
_ driver.Valuer = UnixMilli{}
_ sql.Scanner = (*UnixMilli)(nil)
)
1 change: 0 additions & 1 deletion types/uuid.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,4 @@ func (uuid UUID) Value() (driver.Value, error) {
var (
_ encoding.TextUnmarshaler = (*UUID)(nil)
_ driver.Valuer = UUID{}
_ driver.Valuer = (*UUID)(nil)
)

0 comments on commit 72ab1a1

Please sign in to comment.