Skip to content

Commit

Permalink
MINOR: lint: remove typecheck for nil interface
Browse files Browse the repository at this point in the history
  • Loading branch information
mjuraga committed Feb 13, 2024
1 parent 15002b1 commit c5a4b9c
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions client_native.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ type haProxyClient struct {
func (c *haProxyClient) Configuration() (configuration.Configuration, error) {
c.configurationMu.RLock()
defer c.configurationMu.RUnlock()
if c.configuration == nil {
if c.configuration == nil { //nolint:typecheck
return nil, fmt.Errorf("configuration: %w", ErrOptionNotAvailable)
}
return c.configuration, nil
Expand All @@ -69,35 +69,35 @@ func (c *haProxyClient) ReplaceRuntime(runtime runtime.Runtime) {
func (c *haProxyClient) Runtime() (runtime.Runtime, error) {
c.runtimeMu.RLock()
defer c.runtimeMu.RUnlock()
if c.runtime == nil {
if c.runtime == nil { //nolint:typecheck
return nil, fmt.Errorf("runtime: %w", ErrOptionNotAvailable)
}
return c.runtime, nil
}

func (c *haProxyClient) MapStorage() (storage.Storage, error) {
if c.mapStorage == nil {
if c.mapStorage == nil { //nolint:typecheck
return nil, fmt.Errorf("map storage: %w", ErrOptionNotAvailable)
}
return c.mapStorage, nil
}

func (c *haProxyClient) SSLCertStorage() (storage.Storage, error) {
if c.sslCertStorage == nil {
if c.sslCertStorage == nil { //nolint:typecheck
return nil, fmt.Errorf("ssl cert storage: %w", ErrOptionNotAvailable)
}
return c.sslCertStorage, nil
}

func (c *haProxyClient) GeneralStorage() (storage.Storage, error) {
if c.generalStorage == nil {
if c.generalStorage == nil { //nolint:typecheck
return nil, fmt.Errorf("general files storage: %w", ErrOptionNotAvailable)
}
return c.generalStorage, nil
}

func (c *haProxyClient) Spoe() (spoe.Spoe, error) {
if c.spoe == nil {
if c.spoe == nil { //nolint:typecheck
return nil, fmt.Errorf("spoe: %w", ErrOptionNotAvailable)
}
return c.spoe, nil
Expand Down

0 comments on commit c5a4b9c

Please sign in to comment.