Il giorno venerdì 22 gennaio 2021 alle 20:02:02 UTC+1 dmit...@golang.org ha
scritto:
> > Consider the case where example.com/m1/nested is not a separate module.
> > Due to the rule of "Patterns must not contain ‘.’ or ‘..’ path
> elements", the nested package can not embed, as an example, the LI
> Consider the case where example.com/m1/nested is not a separate module.
> Due to the rule of "Patterns must not contain ‘.’ or ‘..’ path elements",
the nested package can not embed, as an example, the LICENSE file from the
example.com/m1 package.
> The LICENSE file is not outside the nested pac
Thanks for the clarification. The goal was to understand the embedding
better.
I have another question.
Consider the case where example.com/m1/nested is not a separate module.
Due to the rule of "Patterns must not contain ‘.’ or ‘..’ path elements",
the nested package can not embed, as an examp
In general, embedding files from directories starting with dot ("hidden
directories") works fine. But you must take care, to either mention the
hidden directory explicitly, or the file you want to exclude, as otherwise,
the hidden directory will be skipped by embed (see
https://github.com/golang/go
It gets pretty subtle. The ".git" directories aren't included in module
zips by the go command (I don't know if this is documented anywhere, but
it's very sensible behavior), but they aren't disallowed. A custom module
zip may include a ".foo", "_foo", or even ".git" directory with files.
In th
https://golang.org/ref/mod#zip-path-size-constraints prevents directories
that begin with a dot, but only because the directory is interpreted as a
package.
It is not clear, to me, if `.git` is ignored by the `embed` directive
because it is the private directory of the VCS or because it starts w
Directories named testdata are included in the module; they're needed for
tests to run. The most important thing that's left out are subdirectories
that contain a go.mod file, since the content of such directories is a
different module.
Some good places to look for full details include
https:/
I think this is the best doc about what is included in a module:
https://golang.org/ref/mod#zip-path-size-constraints
Everything not in that list is "outside" that module.
On Sat, Jan 16, 2021 at 9:02 PM Manlio Perillo
wrote:
> Thanks. I was only considering the parent of the module's root dire
As an example: is testdata outside the package's module?
Thanks
Manlio
Il giorno sabato 16 gennaio 2021 alle 21:02:25 UTC+1 Manlio Perillo ha
scritto:
> Thanks. I was only considering the parent of the module's root directory.
> Is the concept of "outside the module" defined somewhere?
>
> Man
Thanks. I was only considering the parent of the module's root directory.
Is the concept of "outside the module" defined somewhere?
Manlio Perillo
Il giorno sabato 16 gennaio 2021 alle 19:30:05 UTC+1
axel.wa...@googlemail.com ha scritto:
> To put it another way:
>
> The second phrase is a lex
To put it another way:
The second phrase is a lexical requirement about the pattern. It must not
contain a . or .. element - whether or not the result is included in the
module (e.g. "foo/../foo/bar" is not allowed either, even though it's
equivalent to "foo/bar").
But, a lexical path *in* the mo
I don't think they do. There are two examples in the first phrase, which
are not excluded by the second - the ".git" directory and a symbolic link
(pointing outside of the module).
On Sat, Jan 16, 2021 at 7:11 PM Manlio Perillo
wrote:
> I'm reading the https://tip.golang.org/pkg/embed/ package d
I'm reading the https://tip.golang.org/pkg/embed/ package documentation and
I found a possible inconsistency.
At the end of https://tip.golang.org/pkg/embed/#hdr-Directives:
"Patterns must not match files outside the package's module, such as
‘.git/*’ or symbolic links"
and
"Patterns must not co
13 matches
Mail list logo