diff --git a/function.go b/function.go index d20fede..7ef5230 100644 --- a/function.go +++ b/function.go @@ -3,7 +3,6 @@ package main import ( _ "embed" "fmt" - "log" "os" "text/template" ) @@ -26,7 +25,6 @@ func init() { Error.Printf("Error parsing template: %v", err) return } - log.Printf("%#v", functionTemplate) } type ( diff --git a/function.tmpl b/function.tmpl index f9725e3..3799f1c 100644 --- a/function.tmpl +++ b/function.tmpl @@ -1,2 +1,8 @@ ---@diagnostic disable: missing-return, lowercase-global -function {{.Name}}({{range $index, $param := .Params}}{{if $index}}, {{end}}{{$param.Name}}: {{$param.Type}}{{end}}) end \ No newline at end of file +{{range .Arguments -}} +---@param {{.Name}} {{.Type}} {{.Description}} +{{end -}} +{{range .Returns -}} +---@return {{.Type}} {{.Name}} {{if .Description}}#{{.Description}}{{end}} +{{end -}} +function {{.Name}}({{range $index, $param := .Arguments}}{{if $index}}, {{end}}{{$param.Name}}{{end}}) end \ No newline at end of file diff --git a/main.go b/main.go index fd93df7..128c49a 100644 --- a/main.go +++ b/main.go @@ -56,6 +56,7 @@ func main() { Error.Printf("Error parsing HTML: %v", err) return } + foo.Name = "JoinPermanentChannel" log.Printf("%#v", foo) err = foo.WriteFile() if err != nil {