gitee.com/sy_183/go-common@v1.0.5-0.20231205030221-958cfe129b47/assert/must.go (about)

     1  package assert
     2  
     3  func MustSuccess(err error) {
     4  	if err != nil {
     5  		panic(err)
     6  	}
     7  }
     8  
     9  func Must[V any](v V, err error) V {
    10  	MustSuccess(err)
    11  	return v
    12  }