From 38ac8d8e550ec3284de02afc369c2d6c49c210d9 Mon Sep 17 00:00:00 2001 From: saji Date: Sat, 20 May 2023 14:54:10 -0500 Subject: [PATCH] fix skylab template --- skylab/templates/golang.go.tmpl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/skylab/templates/golang.go.tmpl b/skylab/templates/golang.go.tmpl index 42a5eee..d09e9ec 100644 --- a/skylab/templates/golang.go.tmpl +++ b/skylab/templates/golang.go.tmpl @@ -118,13 +118,13 @@ func FromCanFrame(id uint32, data []byte) (Packet, error) { {{- range $p := .Packets }} {{- if $p.Repeat }} case {{ Nx (int $p.Id) $p.Repeat $p.Offset | mapf "0x%X" | strJoin ", " -}}: - var res *{{camelCase $p.Name true}} + var res = &{{camelCase $p.Name true}}{} res.UnmarshalPacket(data) res.Idx = id - {{$p.Id | printf "0x%X" }} return res, nil {{- else }} case {{ $p.Id | printf "0x%X" }}: - var res *{{camelCase $p.Name true}} + var res = &{{camelCase $p.Name true}}{} res.UnmarshalPacket(data) return res, nil {{- end}}