Skip to content

Commit c47bd81

Browse files
author
James Brundage
committed
Merge branch 'PipeScriptFixesAndFun' of https://github.com/StartAutomating/PipeScript into PipeScriptFixesAndFun
2 parents 9a3c7f9 + 9c62506 commit c47bd81

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

docs/Go.Template.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff 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**

0 commit comments

Comments
 (0)