"Go" language specificities

Telosys version : 4.0.0



To define Go as the target language call  #set( $env.language = 'Go' )  in the templates files.

The information below shows the behavior of the generator when 'Go' is the current target language.



Type conversion ( model type to language type )

The language type conversion has an impact on :
Model type     Default        @UnsignedType @NotNull       @PrimitiveType @ObjectType   
string string string string string string
byte byte uint8 byte byte byte
short int16 uint16 int16 int16 int16
int int32 uint32 int32 int32 int32
long int64 uint64 int64 int64 int64
decimal float64 float64 float64 float64 float64
float float32 float32 float32 float32 float32
double float64 float64 float64 float64 float64
boolean bool bool bool bool bool
date time.Time time.Time time.Time time.Time time.Time
time time.Time time.Time time.Time time.Time time.Time
timestamp time.Time time.Time time.Time time.Time time.Time
binary []byte []byte []byte []byte []byte

Remarks

'@UnsignedType' has effect only for byte, short, int, long

'@NotNull' has no effect
'@PrimitiveType' has no effect
'@ObjectType' has no effect



Literals for TRUE, FALSE and NULL

TRUE true
FALSE false
NULL nil


Literal values

Model type Language type Language full type Language literal value example
string string string "AAA"
byte byte byte 1
byte uint8 uint8 1
short int16 int16 1
short uint16 uint16 1
int int32 int32 100
int uint32 uint32 100
long int64 int64 1000
long uint64 uint64 1000
decimal float64 float64 10000.77
float float32 float32 1000.5
double float64 float64 1000.66
boolean bool bool true
date time.Time time.Time nil
time time.Time time.Time nil
timestamp time.Time time.Time nil
binary []byte []byte nil