...

Source file src/github.com/launchdarkly/go-server-sdk/v6/internal/sharedtest/mocks/assert.go

Documentation: github.com/launchdarkly/go-server-sdk/v6/internal/sharedtest/mocks

     1  package mocks
     2  
     3  import (
     4  	"reflect"
     5  )
     6  
     7  // AssertNotNil forces a panic if the specified value is nil (either a nil interface value, or a
     8  // nil pointer).
     9  func AssertNotNil(i interface{}) {
    10  	if i != nil {
    11  		val := reflect.ValueOf(i)
    12  		if val.Kind() != reflect.Ptr || !val.IsNil() {
    13  			return
    14  		}
    15  	}
    16  	panic("unexpected nil pointer or nil interface value")
    17  }
    18  

View as plain text