File tree Expand file tree Collapse file tree 1 file changed +31
-0
lines changed
Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change 1515 * ```nil```
1616 * ```""```
1717 * ```''```
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+ . EXAMPLE
28+ $HelloWorld = {param([Alias('msg')]$message = "Hello world") "`"$message`""}
29+ $helloGo = HelloWorld.go template "
30+ package main
31+
32+ import `"fmt`"
33+ func main() {
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+
1849#>
1950[ValidatePattern (' \.go$' )]
2051param (
You can’t perform that action at this time.
0 commit comments