README ¶
my_goland_binds
<template name=":" value="$NAME$ := $VALUE$$END$" description="Variable declaration :=" toReformat="true" toShortenFQNames="true">
<variable name="NAME" expression="" defaultValue=""name"" alwaysStopAt="true" />
<variable name="VALUE" expression="complete()" defaultValue="" alwaysStopAt="true" />
<context />
</template>
<template name="bench" value="func Benchmark$NAME$(b *testing.B) { for i := 0; i < b.N; i++ { $END$ } }" description="Benchmark" toReformat="true" toShortenFQNames="true">
<variable name="NAME" expression="" defaultValue=""Name"" alwaysStopAt="true" />
<context />
</template>
<template name="consts" value="const ( $NAME$ = $VALUE$$END$ ) " description="Constants declaration" toReformat="true" toShortenFQNames="true">
<variable name="NAME" expression="" defaultValue=""name"" alwaysStopAt="true" />
<variable name="VALUE" expression="complete()" defaultValue="" alwaysStopAt="true" />
<context />
</template>
<template name="ctx" value="context.$VALUE$$END$" description="context.*" toReformat="false" toShortenFQNames="true">
<variable name="VALUE" expression="complete()" defaultValue="Context" alwaysStopAt="true" />
<context>
<option name="GO" value="true" />
<option name="HTTP_CLIENT_ENVIRONMENT" value="true" />
<option name="REQUEST" value="true" />
</context>
</template>
<template name="ctxC" value="$NAME$, $NAME$Cancel := context.WithCancel($CONTEXT$) defer $NAME$Cancel() $END$" description="context.WithTimeout" toReformat="false" toShortenFQNames="true">
<variable name="NAME" expression="" defaultValue=""ctx"" alwaysStopAt="true" />
<variable name="CONTEXT" expression="complete()" defaultValue=""context.TODO"" alwaysStopAt="true" />
<context>
<option name="GO" value="true" />
</context>
</template>
<template name="ctxT" value="$NAME$, $NAME$Cancel := context.WithTimeout($CONTEXT$, $TIME$) defer $NAME$Cancel() $END$" description="context.WithTimeout" toReformat="false" toShortenFQNames="true">
<variable name="NAME" expression="" defaultValue=""ctx"" alwaysStopAt="true" />
<variable name="CONTEXT" expression="complete()" defaultValue=""context.TODO"" alwaysStopAt="true" />
<variable name="TIME" expression="complete()" defaultValue=""time.Second"" alwaysStopAt="true" />
<context>
<option name="GO" value="true" />
</context>
</template>
<template name="errr" value="if $ERR$ != nil { return $RETURN$errors.Wrap($ERR$, "$TEXT$")$END$ }" description="if err return wraped" toReformat="false" toShortenFQNames="true">
<variable name="ERR" expression="errorVariable()" defaultValue=""err"" alwaysStopAt="true" />
<variable name="RETURN" expression="regularExpression(defaultReturnValues, "([^,]*$)", "")" defaultValue="" alwaysStopAt="true" />
<variable name="TEXT" expression="errorVariable()" defaultValue="" alwaysStopAt="true" />
<context>
<option name="GO" value="true" />
</context>
</template>
<template name="fori" value="for $INDEX$ := 0; $INDEX$ < $LIMIT$; $INDEX$++ { $END$ }" description="Indexed for loop" toReformat="true" toShortenFQNames="true">
<variable name="INDEX" expression="" defaultValue=""n"" alwaysStopAt="true" />
<variable name="LIMIT" expression="" defaultValue="""" alwaysStopAt="true" />
<context />
</template>
<template name="forr" value="for $KEY$, $VALUE$ := range $COLLECTION$ { $END$ }" description="For range loop" toReformat="true" toShortenFQNames="true">
<variable name="COLLECTION" expression="complete()" defaultValue=""collection"" alwaysStopAt="true" />
<variable name="KEY" expression="goSuggestVariableName()" defaultValue=""key"" alwaysStopAt="true" />
<variable name="VALUE" expression="goSuggestVariableName()" defaultValue=""value"" alwaysStopAt="true" />
<context />
</template>
<template name="func" value="func $NAME$($PARAMS$) ($TYPE_1$, $ERR_TYPE$) { $END$ return $TYPE_1$, nil }" description="" toReformat="false" toShortenFQNames="true">
<variable name="NAME" expression="" defaultValue="" alwaysStopAt="true" />
<variable name="PARAMS" expression="complete()" defaultValue="" alwaysStopAt="true" />
<variable name="TYPE_1" expression="complete()" defaultValue="" alwaysStopAt="true" />
<variable name="ERR_TYPE" expression="errorVariableDefinition(expressionWithErrorResult)" defaultValue=""error"" alwaysStopAt="true" />
<context>
<option name="GO" value="true" />
</context>
</template>
<template name="if" value="if $PARAMS$ == nil { $END$ }" description="if" toReformat="false" toShortenFQNames="true">
<variable name="PARAMS" expression="complete()" defaultValue="" alwaysStopAt="true" />
<context>
<option name="GO" value="true" />
</context>
</template>
<template name="if!" value="if $ERR$ != nil { $END$ }" description="If error" toReformat="true" toShortenFQNames="true">
<variable name="ERR" expression="errorVariable()" defaultValue=""err"" alwaysStopAt="true" />
<context>
<option name="GO_STATEMENT" value="true" />
</context>
</template>
<template name="imports" value="import ( "$END$" ) " description="Imports declaration" toReformat="true" toShortenFQNames="true">
<context />
</template>
<template name="init" value="func init() { $END$ }" description="Init function" toReformat="true" toShortenFQNames="true">
<context />
</template>
<template name="iota" value="const $NAME$ $TYPE$ = iota" description="Iota constant declaration" toReformat="true" toShortenFQNames="true">
<variable name="NAME" expression="" defaultValue=""name"" alwaysStopAt="true" />
<variable name="TYPE" expression="complete()" defaultValue="" alwaysStopAt="true" />
<context />
</template>
<template name="jsonc" value="'json:"$FIELD_NAME$"'$END$" description="json tag from field name" toReformat="false" toShortenFQNames="true">
<variable name="FIELD_NAME" expression="camelCase(fieldName())	" defaultValue="" alwaysStopAt="true" />
<context>
<option name="GO" value="true" />
</context>
</template>
<template name="lop" value="lorep ipsum" description="lorep ipsum" toReformat="false" toShortenFQNames="true">
<context>
<option name="GO" value="true" />
</context>
</template>
<template name="main" value="func main() { $END$ }" description="Main function" toReformat="true" toShortenFQNames="true">
<context />
</template>
<template name="map" value="map[$KEY_TYPE$]$VALUE_TYPE$" description="Map type" toReformat="true" toShortenFQNames="true">
<variable name="KEY_TYPE" expression="complete()" defaultValue="" alwaysStopAt="true" />
<variable name="VALUE_TYPE" expression="complete()" defaultValue="" alwaysStopAt="true" />
<context />
</template>
<template name="meth" value="func ($RECEIVER$ *$TYPE_1$) $NAME$($PARAMS$) ($TYPE_1$, $ERR_TYPE$) { $END$ return $TYPE_1$, nil }" description="Method" toReformat="true" toShortenFQNames="true">
<variable name="TYPE_1" expression="complete()" defaultValue="""" alwaysStopAt="true" />
<variable name="NAME" expression="" defaultValue=""name"" alwaysStopAt="true" />
<variable name="RECEIVER" expression="completeSmart()" defaultValue=""s"" alwaysStopAt="true" />
<variable name="PARAMS" expression="" defaultValue="" alwaysStopAt="true" />
<variable name="ERR_TYPE" expression="errorVariableDefinition(expressionWithErrorResult)" defaultValue=""error"" alwaysStopAt="true" />
<context />
</template>
<template name="mkm" value="make(map[$TYPE_1$]$TYPE_2$, $LEN$, $CAP$)$END$" description="make map" toReformat="false" toShortenFQNames="true">
<variable name="TYPE_1" expression="completeSmart()" defaultValue="" alwaysStopAt="true" />
<variable name="TYPE_2" expression="completeSmart()" defaultValue="" alwaysStopAt="true" />
<variable name="LEN" expression="completeSmart()" defaultValue=""0"" alwaysStopAt="true" />
<variable name="CAP" expression="completeSmart()" defaultValue=""0"" alwaysStopAt="true" />
<context>
<option name="GO" value="true" />
</context>
</template>
<template name="mks" value="make([]$TYPE_1$, $LEN$, $CAP$)$END$" description="make slice" toReformat="false" toShortenFQNames="true">
<variable name="TYPE_1" expression="completeSmart()" defaultValue="" alwaysStopAt="true" />
<variable name="LEN" expression="completeSmart()" defaultValue=""0"" alwaysStopAt="true" />
<variable name="CAP" expression="completeSmart()" defaultValue=""0"" alwaysStopAt="true" />
<context>
<option name="GO" value="true" />
</context>
</template>
<template name="p" value="package $NAME$" description="Package declaration" toReformat="true" toShortenFQNames="true">
<variable name="NAME" expression="complete()" defaultValue="" alwaysStopAt="true" />
<context />
</template>
<template name="printf" value="log.Printf("$END$",$VAR$)" description="printf" toReformat="true" toShortenFQNames="true">
<variable name="VAR" expression="complete()" defaultValue="" alwaysStopAt="true" />
<context />
</template>
<template name="slc" value="select { case $CHAN1$: case $CHAN2$: case $CONTEXT$.Done(): default: }" description="select" toReformat="false" toShortenFQNames="true">
<variable name="CHAN1" expression="completeSmart()" defaultValue=""ch1"" alwaysStopAt="true" />
<variable name="CHAN2" expression="completeSmart()" defaultValue=""ch2"" alwaysStopAt="true" />
<variable name="CONTEXT" expression="completeSmart()" defaultValue=""ctx"" alwaysStopAt="true" />
<context>
<option name="GO" value="true" />
</context>
</template>
<template name="st" value="type $TYPE_1$ struct { $END$ }" description="struct" toReformat="false" toShortenFQNames="true">
<variable name="TYPE_1" expression="" defaultValue=""NewMyStruct"" alwaysStopAt="true" />
<context>
<option name="GO" value="true" />
</context>
</template>
<template name="sw" value="switch $PARAMS$ { case $PARAMS_2$: case $PARAMS_3$: default: $END$ }" description="switch" toReformat="false" toShortenFQNames="true">
<variable name="PARAMS" expression="completeSmart()" defaultValue="true" alwaysStopAt="true" />
<variable name="PARAMS_2" expression="completeSmart()" defaultValue="" alwaysStopAt="true" />
<variable name="PARAMS_3" expression="completeSmart()" defaultValue="" alwaysStopAt="true" />
<context>
<option name="GO" value="true" />
</context>
</template>
<template name="test" value="func Test$NAME$(t *testing.T) { $END$ }" description="Test" toReformat="true" toShortenFQNames="true">
<variable name="NAME" expression="" defaultValue=""Name"" alwaysStopAt="true" />
<context />
</template>
<template name="types" value="type ( $END$ ) " description="Types declaration" toReformat="true" toShortenFQNames="true">
<context />
</template>
<template name="vars" value="var ( $NAME$ = $VALUE$$END$ ) " description="Variables declaration" toReformat="true" toShortenFQNames="true">
<variable name="NAME" expression="" defaultValue=""name"" alwaysStopAt="true" />
<variable name="VALUE" expression="complete()" defaultValue="" alwaysStopAt="true" />
<context />
</template>
<template name="wrap" value="$END$ errors.Wrap($ERR$, "$TEXT$")$END$" description="errors.wrap" toReformat="false" toShortenFQNames="true">
<variable name="ERR" expression="errorVariable()" defaultValue=""err"" alwaysStopAt="true" />
<variable name="TEXT" expression="errorVariable()" defaultValue="" alwaysStopAt="true" />
<context>
<option name="GO" value="true" />
</context>
</template>
Documentation ¶
There is no documentation for this package.
Click to show internal directories.
Click to hide internal directories.