在Swig生成的Go代码中获取空指针取消引用

Assuming TYPE1, TYPE2, TYPE3 are typedefs to structs, I have a function in C like this:

int dostuff(TYPE1 *arg1, TYPE2 *arg2, TYPE3 *arg3);

The function checks for null pointers and handles them correctly.

I have wrapped this in Go using Swig, resulting in the following:

func Dostuff(arg1 TYPE1, arg2 TYPE2, arg3 TYPE3) {
    _swig_i_0 := arg1.Swigcptr()
    _swig_i_1 := arg2.Swigcptr()
    _swig_i_2 := arg3.Swigcptr()
    ...
}

If I pass in nil for any of the arguments, I get:

panic: runtime error: invalid memory address or nil pointer dereference

And the stack trace clearly points to the argx.Swigcptr() line as the offender. I am confused, because from the Swig docs, it supposedly allows null pointers as arguments and simply passes them through as such, leaving checking up to the underlying library code (which is what I want). Am I doing something obviously incorrect?

I am using Swig 3.0.6 and go 1.4.2 on Ubuntu.