MCPcopy
hub / github.com/redis/go-redis / Validate

Method Validate

commands.go:345–353  ·  view source on GitHub ↗

Validate checks if only one field in the struct is non-nil.

()

Source from the content-addressed store, hash-verified

343
344// Validate checks if only one field in the struct is non-nil.
345func (info LibraryInfo) Validate() error {
346 if info.LibName != nil && info.LibVer != nil {
347 return errors.New("both LibName and LibVer cannot be set at the same time")
348 }
349 if info.LibName == nil && info.LibVer == nil {
350 return errors.New("at least one of LibName and LibVer should be set")
351 }
352 return nil
353}
354
355// Hello sets the resp protocol used.
356func (c statefulCmdable) Hello(ctx context.Context,

Calls

no outgoing calls