Skip to content

Commit 8f5f6db

Browse files
apvailshuLhan
authored andcommitted
Updated various documentaion to reflect regex changes to -prefix.
1 parent 8a228ce commit 8f5f6db

File tree

3 files changed

+22
-20
lines changed

3 files changed

+22
-20
lines changed

README.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -152,12 +152,13 @@ The default behaviour of the program is to use compression.
152152

153153
### Path prefix stripping
154154

155-
The keys used in the `_bindata` map, are the same as the input file name
156-
passed to `go-bindata`. This includes the path. In most cases, this is not
157-
desireable, as it puts potentially sensitive information in your code base.
158-
For this purpose, the tool supplies another command line flag `-prefix`.
159-
This accepts a portion of a path name, which should be stripped off from
160-
the map keys and function names.
155+
The keys used in the `_bindata` map are the same as the input file name passed
156+
to `go-bindata`. This includes the path. In most cases, this is not desireable,
157+
as it puts potentially sensitive information in your code base. For this
158+
purpose, the tool supplies another command line flag `-prefix`. This accepts a
159+
[regular expression](https://github.com/google/re2/wiki/Syntax) string, which
160+
will be used to match a portion of the map keys and function names that should
161+
be stripped out.
161162

162163
For example, running without the `-prefix` flag, we get:
163164

@@ -167,7 +168,7 @@ For example, running without the `-prefix` flag, we get:
167168

168169
Running with the `-prefix` flag, we get:
169170

170-
$ go-bindata -prefix "/path/to/" /path/to/templates/
171+
$ go-bindata -prefix "/.*/some/" /a/path/to/some/templates/
171172

172173
_bindata["templates/foo.html"] = templates_foo_html
173174

config.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,17 +42,17 @@ type Config struct {
4242
// working directory.
4343
Output string
4444

45-
// Prefix defines a path prefix which should be stripped from all
46-
// file names when generating the keys in the table of contents.
47-
// For example, running without the `-prefix` flag, we get:
45+
// Prefix defines a regular expression which should used to strip
46+
// substrings from all file names when generating the keys in the table of
47+
// contents. For example, running without the `-prefix` flag, we get:
4848
//
4949
// $ go-bindata /path/to/templates
5050
// go_bindata["/path/to/templates/foo.html"] = _path_to_templates_foo_html
5151
//
52-
// Running with the `-prefix` flag, we get:
52+
// Running with the `-prefix` flag, we get:
5353
//
54-
// $ go-bindata -prefix "/path/to/" /path/to/templates/foo.html
55-
// go_bindata["templates/foo.html"] = templates_foo_html
54+
// $ go-bindata -prefix "/.*/some/" /a/path/to/some/templates/
55+
// _bindata["templates/foo.html"] = templates_foo_html
5656
Prefix *regexp.Regexp
5757

5858
// NoMemCopy will alter the way the output file is generated.

doc.go

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -95,12 +95,13 @@ The default behaviour of the program is to use compression.
9595
9696
Path prefix stripping
9797
98-
The keys used in the `_bindata` map are the same as the input file name
99-
passed to `go-bindata`. This includes the path. In most cases, this is not
100-
desireable, as it puts potentially sensitive information in your code base.
101-
For this purpose, the tool supplies another command line flag `-prefix`.
102-
This accepts a portion of a path name, which should be stripped off from
103-
the map keys and function names.
98+
The keys used in the `_bindata` map are the same as the input file name passed
99+
to `go-bindata`. This includes the path. In most cases, this is not desireable,
100+
as it puts potentially sensitive information in your code base. For this
101+
purpose, the tool supplies another command line flag `-prefix`. This accepts a
102+
[regular expression](https://github.com/google/re2/wiki/Syntax) string, which
103+
will be used to match a portion of the map keys and function names that should
104+
be stripped out.
104105
105106
For example, running without the `-prefix` flag, we get:
106107
@@ -110,7 +111,7 @@ For example, running without the `-prefix` flag, we get:
110111
111112
Running with the `-prefix` flag, we get:
112113
113-
$ go-bindata -prefix "/path/to/" /path/to/templates/
114+
$ go-bindata -prefix "/.*\/some/" /a/path/to/some/templates/
114115
115116
_bindata["templates/foo.html"] = templates_foo_html
116117

0 commit comments

Comments
 (0)