Added server example

This commit is contained in:
Eduard Urbach 2025-02-06 12:49:17 +01:00
parent 9c53235e7e
commit 559df424d3
Signed by: eduard
GPG key ID: 49226B848C78F6C8
5 changed files with 71 additions and 7 deletions

View file

@ -35,7 +35,15 @@ func (s *Scanner) scanStruct(file *fs.File, tokens token.List, i int) (int, erro
fieldTypeName := tokens[i].Text(file.Bytes)
fieldType := types.Int
if fieldTypeName != "Int" {
switch fieldTypeName {
case "Int", "Int64":
case "Int32":
fieldType = types.Int32
case "Int16":
fieldType = types.Int16
case "Int8":
fieldType = types.Int8
default:
panic("not implemented")
}