I am moving the C library to Go. The C function (with varargs) is defined as follows:
curl_easy_setopt(CURL *curl, CURLoption option, ...);
So, I created C shell functions:
curl_wrapper_easy_setopt_str(CURL *curl, CURLoption option, char* param); curl_wrapper_easy_setopt_long(CURL *curl, CURLoption option, long param);
If I define a function in Go as follows:
func (e *Easy)SetOption(option Option, param string) { e.code = Code(C.curl_wrapper_easy_setopt_str(e.curl, C.CURLoption(option), C.CString(param))) } func (e *Easy)SetOption(option Option, param long) { e.code = Code(C.curl_wrapper_easy_setopt_long(e.curl, C.CURLoption(option), C.long(param))) }
The Go compiler complains:
*Easy·SetOption redeclared in this block
So, is the function function (method) Go function overloaded, or does this error mean something else?
go
Darius Kucinskas Aug 08 2018-11-18T00: 00Z
source share