github.com/searKing/golang/go@v1.2.117/error/must/must.go (about)

     1  // Copyright 2020 The searKing Author. All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  package must
     6  
     7  // Must panics if err != nil
     8  // Deprecated: Use errors.Must instead.
     9  func Must(err error) {
    10  	if err == nil {
    11  		return
    12  	}
    13  	panic(err)
    14  }