diff --git a/internal/native/verifier.go b/internal/native/verifier.go index 735a9d7c2..35a91014a 100644 --- a/internal/native/verifier.go +++ b/internal/native/verifier.go @@ -111,19 +111,19 @@ func (v *Verifier) SetFilterInfo(description string, state string, noState bool) cFilterState := C.CString(state) defer free(cFilterState) - C.pactffi_verifier_set_filter_info(v.handle, cFilterDescription, cFilterState, boolToCInt(noState)) + C.pactffi_verifier_set_filter_info(v.handle, cFilterDescription, cFilterState, boolToCUchar(noState)) } func (v *Verifier) SetProviderState(url string, teardown bool, body bool) { cURL := C.CString(url) defer free(cURL) - C.pactffi_verifier_set_provider_state(v.handle, cURL, boolToCInt(teardown), boolToCInt(body)) + C.pactffi_verifier_set_provider_state(v.handle, cURL, boolToCUchar(teardown), boolToCUchar(body)) } func (v *Verifier) SetVerificationOptions(disableSSLVerification bool, requestTimeout int64) { // TODO: this returns an int and therefore can error. We should have all of these functions return values?? - C.pactffi_verifier_set_verification_options(v.handle, boolToCInt(disableSSLVerification), C.ulong(requestTimeout)) + C.pactffi_verifier_set_verification_options(v.handle, boolToCUchar(disableSSLVerification), C.ulong(requestTimeout)) } func (v *Verifier) SetConsumerFilters(consumers []string) { @@ -181,7 +181,7 @@ func (v *Verifier) BrokerSourceWithSelectors(url string, username string, passwo cProviderBranch := C.CString(providerBranch) defer free(cProviderBranch) - C.pactffi_verifier_broker_source_with_selectors(v.handle, cUrl, cUsername, cPassword, cToken, boolToCInt(enablePending), cIncludeWipPactsSince, stringArrayToCStringArray(providerTags), C.ushort(len(providerTags)), cProviderBranch, stringArrayToCStringArray(selectors), C.ushort(len(selectors)), stringArrayToCStringArray(consumerVersionTags), C.ushort(len(consumerVersionTags))) + C.pactffi_verifier_broker_source_with_selectors(v.handle, cUrl, cUsername, cPassword, cToken, boolToCUchar(enablePending), cIncludeWipPactsSince, stringArrayToCStringArray(providerTags), C.ushort(len(providerTags)), cProviderBranch, stringArrayToCStringArray(selectors), C.ushort(len(selectors)), stringArrayToCStringArray(consumerVersionTags), C.ushort(len(consumerVersionTags))) } func (v *Verifier) SetPublishOptions(providerVersion string, buildUrl string, providerTags []string, providerBranch string) { @@ -216,11 +216,11 @@ func (v *Verifier) Execute() error { } func (v *Verifier) SetNoPactsIsError(isError bool) { - C.pactffi_verifier_set_no_pacts_is_error(v.handle, boolToCInt(isError)) + C.pactffi_verifier_set_no_pacts_is_error(v.handle, boolToCUchar(isError)) } func (v *Verifier) SetColoredOutput(isColoredOutput bool) { - C.pactffi_verifier_set_coloured_output(v.handle, boolToCInt(isColoredOutput)) + C.pactffi_verifier_set_coloured_output(v.handle, boolToCUchar(isColoredOutput)) } func stringArrayToCStringArray(inputs []string) **C.char { @@ -237,7 +237,7 @@ func stringArrayToCStringArray(inputs []string) **C.char { return (**C.char)(unsafe.Pointer(&output[0])) } -func boolToCInt(val bool) C.uchar { +func boolToCUchar(val bool) C.uchar { if val { return C.uchar(1) }