Passed
Push — master ( 23e371...7b0ca1 )
by Stefano
02:15
created

common.Must   A

Complexity

Conditions 2

Size

Total Lines 3
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 3
nop 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
package common
2
3
import "github.com/pkg/errors"
4
5
// Must accepts an error in input, if the error is not nil it panics
6
// It helps to simplify code where no error is expected
7
func Must(err error) {
8
	if err != nil {
9
		panic(errors.WithStack(err))
10
	}
11
}
12