Fix up template
This commit is contained in:
@@ -3,7 +3,6 @@ package main
|
|||||||
import (
|
import (
|
||||||
_ "embed"
|
_ "embed"
|
||||||
"fmt"
|
"fmt"
|
||||||
"log"
|
|
||||||
"os"
|
"os"
|
||||||
"text/template"
|
"text/template"
|
||||||
)
|
)
|
||||||
@@ -26,7 +25,6 @@ func init() {
|
|||||||
Error.Printf("Error parsing template: %v", err)
|
Error.Printf("Error parsing template: %v", err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
log.Printf("%#v", functionTemplate)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
type (
|
type (
|
||||||
|
@@ -1,2 +1,8 @@
|
|||||||
---@diagnostic disable: missing-return, lowercase-global
|
---@diagnostic disable: missing-return, lowercase-global
|
||||||
function {{.Name}}({{range $index, $param := .Params}}{{if $index}}, {{end}}{{$param.Name}}: {{$param.Type}}{{end}}) end
|
{{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
|
1
main.go
1
main.go
@@ -56,6 +56,7 @@ func main() {
|
|||||||
Error.Printf("Error parsing HTML: %v", err)
|
Error.Printf("Error parsing HTML: %v", err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
foo.Name = "JoinPermanentChannel"
|
||||||
log.Printf("%#v", foo)
|
log.Printf("%#v", foo)
|
||||||
err = foo.WriteFile()
|
err = foo.WriteFile()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Reference in New Issue
Block a user