//golangcitest:args -Erevive //golangcitest:config_path testdata/revive.yml package testdata /* #include #include void myprint(char* s) { printf("%d\n", s); } */ import "C" import ( "net/http" "time" "unsafe" ) func _() { cs := C.CString("Hello from stdio\n") C.myprint(cs) C.free(unsafe.Pointer(cs)) } func _(t *time.Duration) error { if t == nil { return nil } else { return nil } } func _(s string) { // want "cyclomatic: function _ has cyclomatic complexity 22" if s == http.MethodGet || s == "2" || s == "3" || s == "4" || s == "5" || s == "6" || s == "7" { return } if s == "1" || s == "2" || s == "3" || s == "4" || s == "5" || s == "6" || s == "7" { return } if s == "1" || s == "2" || s == "3" || s == "4" || s == "5" || s == "6" || s == "7" { return } }