github.com/xmidt-org/webpa-common@v1.11.9/xhttp/converter/duration.go (about)

     1  package converter
     2  
     3  import (
     4  	"reflect"
     5  	"time"
     6  )
     7  
     8  func Duration(v string) reflect.Value {
     9  	d, err := time.ParseDuration(v)
    10  	if err != nil {
    11  		return reflect.Value{}
    12  	}
    13  
    14  	return reflect.ValueOf(d)
    15  }