in lib/helper.js [178:260]
function _initValue(type) {
if (type === 'number' || type === 'integer') {
return `${_setExtendFunc(type)}0)`;
}
if (type === 'string') {
return `${_setExtendFunc(type)}"")`;
}
if (type === 'boolean') {
return `${_setExtendFunc(type)}false)`;
}
if (type === 'bytes') {
return 'make([]byte, 0)';
}
if (type === 'any' || type === 'class' || type === '$Model') {
return 'interface{}(nil)';
}
if (type === '$Error') {
return '&dara.SDKError{}';
}
if (type === 'float') {
return `${_setExtendFunc(type)}0.00)`;
}
if (type === 'null') {
return 'nil';
}
if (type === '$Response') {
return '&dara.Response{}';
}
if (type === '$Request') {
return '&dara.Request{}';
}
if (type === '$SSEEvent') {
return '&dara.SSEEvent{}';
}
if (type === '$Date') {
return '&dara.Date{}';
}
if (type === '$File') {
return '&dara.File{}';
}
if (type === '$RetryOptions') {
return '&dara.RetryOptions{}';
}
if (type === '$RuntimeOptions') {
return '&dara.RuntimeOptions{}';
}
if (type === '$ExtendsParameters') {
return '&dara.ExtendsParameters{}';
}
if (type === '$URL') {
return '&dara.URL{}';
}
if (type === '$Stream') {
return '&dara.Stream{}';
}
if (type === 'object') {
return 'make(map[string]interface{})';
}
if (type.startsWith('map')) {
return `make(${type})`;
}
if (type.startsWith('[]')) {
return `make(${type}, 1)`;
}
return `&${type}{}`;
}