File tree Expand file tree Collapse file tree 1 file changed +34
-0
lines changed
Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Original file line number Diff line number Diff line change @@ -20,6 +20,40 @@ The Go Transpiler will consider the following syntax to be empty:
2020* ``` "" ```
2121* ``` '' ```
2222
23+ ---
24+ ### Examples
25+ #### EXAMPLE 1
26+ ``` PowerShell
27+ $helloGo = HelloWorld.go template '
28+ package main
29+ ```
30+ import "fmt"
31+ func main() {
32+ fmt.Println("/* {param($msg = "hello world") "` "$msg ` ""}* /")
33+ }
34+ '
35+ #### EXAMPLE 2
36+ ``` PowerShell
37+ $HelloWorld = {param([Alias('msg')]$message = "Hello world") "`"$message`""}
38+ $helloGo = HelloWorld.go template "
39+ package main
40+ ```
41+ import ` "fmt ` "
42+ func main() {
43+ fmt.Println(` "/*{$helloWorld}*/ ` ")
44+ }
45+ "
46+
47+ $helloGo.Save() |
48+ Foreach-Object {
49+ $file = $_
50+ if (Get-Command go -commandType Application) {
51+ $null = go build $file.FullName
52+ & ".\$ ($file.Name.Replace($file.Extension, '.exe'))"
53+ } else {
54+ Write-Error "Go install Go"
55+ }
56+ }
2357---
2458### Parameters
2559#### ** CommandInfo**
You can’t perform that action at this time.
0 commit comments