chore: linter: embeddedstructfieldcheck

Signed-off-by: Jakob Borg <jakob@kastelo.net>
This commit is contained in:
Jakob Borg
2025-10-21 22:00:44 +02:00
parent df8d8c276e
commit 7c9d06b4d2
36 changed files with 54 additions and 11 deletions

View File

@@ -653,6 +653,7 @@ func getLocation(host string, geoip *geoip.Provider) location {
type loggingResponseWriter struct {
http.ResponseWriter
statusCode int
}

View File

@@ -23,6 +23,7 @@ import (
type amqpReplicator struct {
suture.Service
broker string
sender *amqpSender
receiver *amqpReceiver

View File

@@ -513,6 +513,7 @@ func fixupAddresses(remote *net.TCPAddr, addresses []string) []string {
type loggingResponseWriter struct {
http.ResponseWriter
statusCode int
}

View File

@@ -32,6 +32,7 @@ type APIClient interface {
type apiClient struct {
http.Client
cfg config.GUIConfiguration
apikey string
}

View File

@@ -10,6 +10,7 @@ import "github.com/jmoiron/sqlx"
type txPreparedStmts struct {
*sqlx.Tx
stmts map[string]*sqlx.Stmt
}

View File

@@ -14,9 +14,10 @@ import (
)
type folderDB struct {
folderID string
*baseDB
folderID string
localDeviceIdx int64
deleteRetention time.Duration
}

View File

@@ -22,6 +22,7 @@ import (
type configMuxBuilder struct {
*httprouter.Router
id protocol.DeviceID
cfg config.Wrapper
}

View File

@@ -32,6 +32,7 @@ type Interface interface {
type cast struct {
*suture.Supervisor
name string
reader svcutil.ServiceWithError
writer svcutil.ServiceWithError

View File

@@ -165,6 +165,7 @@ func (cfg *Configuration) ProbeFreePorts() error {
type xmlConfiguration struct {
Configuration
XMLName xml.Name `xml:"configuration"`
}

View File

@@ -11,6 +11,7 @@ import "github.com/syncthing/syncthing/lib/config"
// invalidListener is never valid
type invalidListener struct {
listenerFactory
err error
}
@@ -25,6 +26,7 @@ func (i invalidListener) Valid(_ config.Configuration) error {
// invalidDialer is never valid
type invalidDialer struct {
dialerFactory
err error
}

View File

@@ -225,8 +225,9 @@ func getRateLimiter(m map[protocol.DeviceID]*rate.Limiter, deviceID protocol.Dev
// limitedReader is a rate limited io.Reader
type limitedReader struct {
reader io.Reader
waiterHolder
reader io.Reader
}
func (r *limitedReader) Read(buf []byte) (int, error) {
@@ -239,8 +240,9 @@ func (r *limitedReader) Read(buf []byte) (int, error) {
// limitedWriter is a rate limited io.Writer
type limitedWriter struct {
writer io.Writer
waiterHolder
writer io.Writer
}
func (w *limitedWriter) Write(buf []byte) (int, error) {

View File

@@ -39,6 +39,7 @@ func init() {
type quicDialer struct {
commonDialer
registry *registry.Registry
}

View File

@@ -39,10 +39,10 @@ func init() {
type quicListener struct {
svcutil.ServiceWithError
nat atomic.Uint64 // Holds a stun.NATType.
onAddressesChangedNotifier
nat atomic.Uint64 // Holds a stun.NATType.
uri *url.URL
cfg config.Wrapper
tlsCfg *tls.Config

View File

@@ -42,6 +42,7 @@ func quicNetwork(uri *url.URL) string {
type quicTlsConn struct {
quic.Connection
quic.Stream
// If we created this connection, we should be the ones closing it.
createdConn net.PacketConn
}

View File

@@ -39,6 +39,7 @@ type tlsConn interface {
// came from (type, priority).
type internalConn struct {
tlsConn
connType connType
isLocal bool
priority int

View File

@@ -27,6 +27,7 @@ func init() {
type tcpDialer struct {
commonDialer
registry *registry.Registry
}

View File

@@ -64,6 +64,7 @@ func socksDialerFunction(u *url.URL, forward proxy.Dialer) (proxy.Dialer, error)
// existing connection" shenanigans.
type dialerConn struct {
net.Conn
addr net.Addr
}

View File

@@ -17,6 +17,7 @@ import (
// A cachedFinder is a Finder with associated cache timeouts.
type cachedFinder struct {
Finder
cacheTime time.Duration
negCacheTime time.Duration
cache *cache

View File

@@ -32,6 +32,8 @@ import (
)
type globalClient struct {
errorHolder
server string
addrList AddressLister
announceClient httpClient
@@ -39,7 +41,6 @@ type globalClient struct {
noAnnounce bool
noLookup bool
evLogger events.Logger
errorHolder
}
type httpClient interface {
@@ -373,6 +374,7 @@ func queryBool(q url.Values, key string) bool {
type idCheckingHTTPClient struct {
httpClient
id protocol.DeviceID
}

View File

@@ -34,6 +34,8 @@ import (
type localClient struct {
*suture.Supervisor
*cache
myID protocol.DeviceID
addrList AddressLister
name string
@@ -43,8 +45,6 @@ type localClient struct {
localBcastStart time.Time
localBcastTick <-chan time.Time
forcedBcastTick chan time.Time
*cache
}
const (

View File

@@ -41,6 +41,7 @@ type Manager interface {
type manager struct {
*suture.Supervisor
myID protocol.DeviceID
cfg config.Wrapper
cert tls.Certificate

View File

@@ -340,6 +340,7 @@ func (*BasicFilesystem) underlying() (Filesystem, bool) {
// basicFile implements the fs.File interface on top of an os.File
type basicFile struct {
*os.File
name string
}

View File

@@ -749,6 +749,7 @@ func (fs *fakeFS) reportMetricsPer(b *testing.B, divisor float64, unit string) {
// opened for reading or writing, it's all good.
type fakeFile struct {
*fakeEntry
mut *sync.Mutex
rng io.Reader
seed int64

View File

@@ -16,6 +16,7 @@ import (
type logFilesystem struct {
Filesystem
// Number of filesystem layers on top of logFilesystem to skip when looking
// for the true caller of the filesystem
layers int

View File

@@ -19,6 +19,7 @@ type database interface {
type mtimeFS struct {
Filesystem
chtimes func(string, time.Time, time.Time) error
db database
folderID string
@@ -170,6 +171,7 @@ func (f *mtimeFS) load(name string) (ondisk, virtual time.Time) {
type mtimeFileInfo struct {
FileInfo
mtime time.Time
}
@@ -179,6 +181,7 @@ func (m mtimeFileInfo) ModTime() time.Time {
type mtimeFile struct {
File
fs *mtimeFS
}

View File

@@ -63,6 +63,7 @@ type WalkFunc func(path string, info FileInfo, err error) error
type walkFilesystem struct {
Filesystem
checkInfiniteRecursion bool
}

View File

@@ -44,6 +44,7 @@ type folder struct {
stateTracker
config.FolderConfiguration
*stats.FolderStatisticsReference
ioLimiter *semaphore.Semaphore
localFlags protocol.FlagLocal

View File

@@ -48,6 +48,7 @@ func init() {
// to be fetched.
type pullBlockState struct {
*sharedPullerState
block protocol.BlockInfo
}
@@ -55,6 +56,7 @@ type pullBlockState struct {
// copied.
type copyBlocksState struct {
*sharedPullerState
blocks []protocol.BlockInfo
have int
}

View File

@@ -690,6 +690,7 @@ type ConnectionStats struct {
type ConnectionInfo struct {
protocol.Statistics
Address string `json:"address"`
Type string `json:"type"`
IsLocal bool `json:"isLocal"`
@@ -3484,6 +3485,7 @@ func redactPathError(err error) (error, bool) {
type redactedError struct {
error
redacted error
}

View File

@@ -14,6 +14,7 @@ import (
type countingReader struct {
io.Reader
idString string
tot atomic.Int64 // bytes
last atomic.Int64 // unix nanos
@@ -41,6 +42,7 @@ func (c *countingReader) Last() time.Time {
type countingWriter struct {
io.Writer
idString string
tot atomic.Int64 // bytes
last atomic.Int64 // unix nanos

View File

@@ -171,6 +171,7 @@ func (e encryptedModel) Closed(err error) {
// encrypts outgoing metadata and decrypts incoming responses.
type encryptedConnection struct {
ConnectionInfo
conn *rawConnection
folderKeys *folderKeyRegistry
keyGen *KeyGenerator

View File

@@ -38,6 +38,7 @@ func NewClient(uri *url.URL, certs []tls.Certificate, timeout time.Duration) (Re
type commonClient struct {
svcutil.ServiceWithError
invitations chan protocol.SessionInvitation
}

View File

@@ -681,9 +681,10 @@ func (w *walker) String() string {
// A byteCounter gets bytes added to it via Update() and then provides the
// Total() and one minute moving average Rate() in bytes per second.
type byteCounter struct {
total atomic.Int64
metrics.EWMA
stop chan struct{}
total atomic.Int64
stop chan struct{}
}
func newByteCounter() *byteCounter {

View File

@@ -200,6 +200,7 @@ func NewCertificateInMemory(commonName string, lifetimeDays int) (tls.Certificat
type DowngradingListener struct {
net.Listener
TLSConfig *tls.Config
}
@@ -244,9 +245,10 @@ func (l *DowngradingListener) AcceptNoWrapTLS() (net.Conn, bool, error) {
}
type UnionedConnection struct {
net.Conn
first [1]byte
firstDone bool
net.Conn
}
func (c *UnionedConnection) Read(b []byte) (n int, err error) {

View File

@@ -41,6 +41,7 @@ var (
type FailureReport struct {
FailureData
Count int
Version string
}

View File

@@ -55,6 +55,7 @@ func New(cfg config.FolderConfiguration) (Versioner, error) {
type versionerWithErrorContext struct {
Versioner
vtype string
}