This repository was archived by the owner on Jul 29, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ import (
15
15
"flag"
16
16
"fmt"
17
17
"go/build"
18
+ "io/ioutil"
18
19
"log"
19
20
"os"
20
21
"path"
37
38
// layout control
38
39
tabWidth = flag .Int ("tabwidth" , 4 , "tab width" )
39
40
showTimestamps = flag .Bool ("timestamps" , false , "show timestamps with directory listings" )
40
- altPkgTemplate = flag .String ("template" , "" , "alternate template" )
41
+ altPkgTemplate = flag .String ("template" , "" , "path to an alternate template file " )
41
42
showPlayground = flag .Bool ("play" , false , "enable playground in web interface" )
42
43
showExamples = flag .Bool ("ex" , false , "show examples in command line mode" )
43
44
declLinks = flag .Bool ("links" , true , "link identifiers to their declarations" )
@@ -123,7 +124,11 @@ func main() {
123
124
pres .HTMLMode = false
124
125
125
126
if * altPkgTemplate != "" {
126
- pres .PackageText = readTemplate ("package.txt" , * altPkgTemplate )
127
+ buf , err := ioutil .ReadFile (* altPkgTemplate )
128
+ if err != nil {
129
+ log .Fatal (err )
130
+ }
131
+ pres .PackageText = readTemplate ("package.txt" , string (buf ))
127
132
} else {
128
133
pres .PackageText = readTemplate ("package.txt" , pkgTemplate )
129
134
}
You can’t perform that action at this time.
0 commit comments