github.com/searKing/golang/go@v1.2.117/errors/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 errors
     6  
     7  // Must panics if err != nil
     8  func Must(err error) {
     9  	if err == nil {
    10  		return
    11  	}
    12  	panic(err)
    13  }