github.com/ars0915/glossika-exercise@v0.0.0-20240904180321-a5617a00d892/util/cError/unwrap.go (about)

     1  package cError
     2  
     3  import "errors"
     4  
     5  func Unwrap(err error) error {
     6  	currentErr := err
     7  	for errors.Unwrap(currentErr) != nil {
     8  		currentErr = errors.Unwrap(currentErr)
     9  	}
    10  	return currentErr
    11  }