We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a9b2ee6 commit ec8b3b8Copy full SHA for ec8b3b8
1 file changed
Transpilers/Templates/Go.Template.psx.ps1
@@ -15,6 +15,37 @@
15
* ```nil```
16
* ```""```
17
* ```''```
18
+.EXAMPLE
19
+ $helloGo = HelloWorld.go template '
20
+ package main
21
+
22
+ import "fmt"
23
+ func main() {
24
+ fmt.Println("/*{param($msg = "hello world") "`"$msg`""}*/")
25
+ }
26
+ '
27
28
+ $HelloWorld = {param([Alias('msg')]$message = "Hello world") "`"$message`""}
29
+ $helloGo = HelloWorld.go template "
30
31
32
+ import `"fmt`"
33
34
+ fmt.Println(`"/*{$helloWorld}*/`")
35
36
+ "
37
38
+ $helloGo.Save() |
39
+ Foreach-Object {
40
+ $file = $_
41
+ if (Get-Command go -commandType Application) {
42
+ $null = go build $file.FullName
43
+ & ".\$($file.Name.Replace($file.Extension, '.exe'))"
44
+ } else {
45
+ Write-Error "Go install Go"
46
47
48
49
#>
50
[ValidatePattern('\.go$')]
51
param(
0 commit comments