fix: lint stub

This commit is contained in:
Igor Sirotin 2025-12-19 00:14:56 +00:00
parent 72b7e81bf3
commit 584f6505ea
No known key found for this signature in database
GPG Key ID: 0EABBCB40CB9AD4A
2 changed files with 13 additions and 7 deletions

View File

@ -137,8 +137,8 @@ import (
"sync" "sync"
"unsafe" "unsafe"
"go.uber.org/zap"
errorspkg "github.com/pkg/errors" errorspkg "github.com/pkg/errors"
"go.uber.org/zap"
) )
var ( var (

View File

@ -2,7 +2,11 @@
package sds package sds
import "errors" import (
"errors"
"go.uber.org/zap"
)
// This file provides lint-only stubs that avoid requiring libsds.h/cgo // This file provides lint-only stubs that avoid requiring libsds.h/cgo
// so linters can analyze this package without native dependencies. // so linters can analyze this package without native dependencies.
@ -11,8 +15,8 @@ import "errors"
var ErrLintBuild = errors.New("sds: lint-only build stub: native libsds not linked") var ErrLintBuild = errors.New("sds: lint-only build stub: native libsds not linked")
// NewReliabilityManager returns an error in lint builds. // NewReliabilityManager returns an error in lint builds.
func NewReliabilityManager() (*ReliabilityManager, error) { func NewReliabilityManager(logger *zap.Logger) (*ReliabilityManager, error) {
return nil, ErrLintBuild return nil, ErrLintBuild
} }
// Cleanup returns an error in lint builds. // Cleanup returns an error in lint builds.
@ -23,16 +27,18 @@ func (rm *ReliabilityManager) Reset() error { return ErrLintBuild }
// WrapOutgoingMessage returns an error in lint builds. // WrapOutgoingMessage returns an error in lint builds.
func (rm *ReliabilityManager) WrapOutgoingMessage(message []byte, messageId MessageID, channelId string) ([]byte, error) { func (rm *ReliabilityManager) WrapOutgoingMessage(message []byte, messageId MessageID, channelId string) ([]byte, error) {
return nil, ErrLintBuild return nil, ErrLintBuild
} }
// UnwrapReceivedMessage returns an error in lint builds. // UnwrapReceivedMessage returns an error in lint builds.
func (rm *ReliabilityManager) UnwrapReceivedMessage(message []byte) (*UnwrappedMessage, error) { func (rm *ReliabilityManager) UnwrapReceivedMessage(message []byte) (*UnwrappedMessage, error) {
return nil, ErrLintBuild return nil, ErrLintBuild
} }
// MarkDependenciesMet returns an error in lint builds. // MarkDependenciesMet returns an error in lint builds.
func (rm *ReliabilityManager) MarkDependenciesMet(messageIDs []MessageID, channelId string) error { return ErrLintBuild } func (rm *ReliabilityManager) MarkDependenciesMet(messageIDs []MessageID, channelId string) error {
return ErrLintBuild
}
// StartPeriodicTasks returns an error in lint builds. // StartPeriodicTasks returns an error in lint builds.
func (rm *ReliabilityManager) StartPeriodicTasks() error { return ErrLintBuild } func (rm *ReliabilityManager) StartPeriodicTasks() error { return ErrLintBuild }