You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This code defines a struct with fields named ReadWriteSeeker, ReaderAt, WriterAt, and Closer which are never used. Notably, Blob itself implements the functions required by these interfaces. If Blob was an interface this syntax would mean that whatever implements Blob must have the methods in the listed interfaces, but written as a struct this syntax defines four separate fields in the struct itself. This appears to be a mistake.
sqlite/blob.go
Lines 81 to 85 in 6c1d4ad
This code defines a struct with fields named
ReadWriteSeeker
,ReaderAt
,WriterAt
, andCloser
which are never used. Notably,Blob
itself implements the functions required by these interfaces. IfBlob
was an interface this syntax would mean that whatever implementsBlob
must have the methods in the listed interfaces, but written as a struct this syntax defines four separate fields in the struct itself. This appears to be a mistake.Here's a playground example that shows this: https://go.dev/play/p/Hr0SlKqYhV9
To require that a struct
Blob
implements the required interfaces, one can use the "interface guards" pattern like this:The text was updated successfully, but these errors were encountered: