When i place your code in my code it produced the following error.
C:\Users\rakhil\go\src\github.com\ibmdb\go_ibm_db>go run sql_check.go
# command-line-arguments
In file included from C:/Program Files/IBM/SQLLIB/include/sqlcli.h:989:0,
from C:/Program Files/IBM/SQLLIB/include/sqlcli1.h:45,
from .\sql_check.go:5:
C:/Program Files/IBM/SQLLIB/include/sqlext.h:1748:5: error: unknown type name '__in_ecount'
__in_ecount(cchConnStrIn)
^
C:/Program Files/IBM/SQLLIB/include/sqlext.h:1751:5: error: unknown type name '__out_ecount_opt'
__out_ecount_opt(cchConnStrOutMax)
^
C:/Program Files/IBM/SQLLIB/include/sqlext.h:1754:5: error: unknown type name '__out_opt'
__out_opt
^
C:/Program Files/IBM/SQLLIB/include/sqlext.h:1865:5: error: unknown type name '__in_ecount'
__in_ecount(cchConnStrIn)
^
C:/Program Files/IBM/SQLLIB/include/sqlext.h:1868:5: error: unknown type name '__out_ecount_opt'
__out_ecount_opt(cchConnStrOutMax)
^
C:/Program Files/IBM/SQLLIB/include/sqlext.h:1871:5: error: unknown type name '__out_opt'
__out_opt
^
C:/Program Files/IBM/SQLLIB/include/sqlext.h:1891:5: error: unknown type name '__in_ecount_opt'
__in_ecount_opt(cchCatalogName)