Skip to content
This repository was archived by the owner on Jul 29, 2021. It is now read-only.

Commit 13b1e28

Browse files
committed
Show usage information if no package provided
Close #1
1 parent 6771258 commit 13b1e28

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

examples/build/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -388,6 +388,7 @@ type Package struct {
388388
IgnoredGoFiles []string // .go source files ignored for this build
389389
CFiles []string // .c source files
390390
CXXFiles []string // .cc, .cpp and .cxx source files
391+
MFiles []string // .m (Objective-C) source files
391392
HFiles []string // .h, .hh, .hpp and .hxx source files
392393
SFiles []string // .s source files
393394
SwigFiles []string // .swig files

main.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ var (
5858
"comment_md": comment_mdFunc,
5959
"base": path.Base,
6060
"md": mdFunc,
61-
"pre": preFunc,
61+
"pre": preFunc,
6262
}
6363
)
6464

@@ -77,7 +77,7 @@ func mdFunc(text string) string {
7777
}
7878

7979
func preFunc(text string) string {
80-
return "``` go\n"+text+"\n```"
80+
return "``` go\n" + text + "\n```"
8181
}
8282

8383
func readTemplate(name, data string) *template.Template {
@@ -97,6 +97,11 @@ func main() {
9797
flag.Usage = usage
9898
flag.Parse()
9999

100+
// Check usage
101+
if flag.NArg() == 0 {
102+
usage()
103+
}
104+
100105
// use file system of underlying OS
101106
fs.Bind("/", vfs.OS(*goroot), "/", vfs.BindReplace)
102107

0 commit comments

Comments
 (0)