FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
sh/syntax/example_test.go at master · vanstee/sh · GitHub
vanstee
/
sh
Public
forked from
mvdan/sh
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
sh
/
syntax
/
example_test.go
Copy path
More file actions
More file actions
Latest commit
History
History
History
25 lines (21 loc) · 392 Bytes
Breadcrumbs
sh
/
syntax
/
example_test.go
Copy path
File metadata and controls
25 lines (21 loc) · 392 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// Copyright (c) 2016, Daniel Martí <mvdan@mvdan.cc>
// See LICENSE for licensing information
package
syntax_test
import
(
"os"
"strings"
"github.com/mvdan/sh/syntax"
)
func
Example
() {
in
:=
strings
.
NewReader
(
"{ foo; bar; }"
)
f
,
err
:=
syntax
.
NewParser
().
Parse
(
in
,
""
)
if
err
!=
nil
{
return
}
syntax
.
NewPrinter
().
Print
(
os
.
Stdout
,
f
)
// Output:
// {
// foo
// bar
// }
}
Back
|
FazBrowse Home
|
New Git URL