github.com/treeverse/lakefs@v1.24.1-0.20240520134607-95648127bfb0/pkg/api/apiutil/util.go (about)

     1  package apiutil
     2  
     3  func IsStatusCodeOK(statusCode int) bool {
     4  	return statusCode >= 200 && statusCode <= 299
     5  }
     6  
     7  func Value[T any](ptr *T) T {
     8  	if ptr == nil {
     9  		return *new(T)
    10  	}
    11  	return *ptr
    12  }
    13  
    14  func Ptr[T any](val T) *T {
    15  	return &val
    16  }