github.com/kyma-project/kyma-environment-broker@v0.0.1/internal/ptr/ptr.go (about)

     1  package ptr
     2  
     3  import (
     4  	"fmt"
     5  	"time"
     6  )
     7  
     8  func Bool(in bool) *bool {
     9  	return &in
    10  }
    11  
    12  func BoolAsString(in *bool) string {
    13  	if in == nil {
    14  		return "nil"
    15  	}
    16  	return fmt.Sprintf("%v", *in)
    17  }
    18  
    19  func String(str string) *string {
    20  	return &str
    21  }
    22  
    23  func ToString(s *string) string {
    24  	if s != nil {
    25  		return *s
    26  	}
    27  	return ""
    28  }
    29  
    30  func Integer(in int) *int {
    31  	return &in
    32  }
    33  
    34  func Time(in time.Time) *time.Time {
    35  	return &in
    36  }