| Age | Commit message (Collapse) | Author |
|
With help of spdxconv tool [1], we able to bulk update all files license
and copyright format to comply with SPDX formats.
[1] https://kilabit.info/project/spdxconv/
|
|
While at it, temporary disable gosec due to excessive report for G115,
which may be true, but may also break the current working program.
We should alter and fix once we can test and make sure that it does not
breaks.
|
|
Using octal in mode make the code more readable, for example mode with
permission "0o644" much more readable than 420.
|
|
|
|
There are several reasons that why we move from github.com.
First, related to the name of package.
We accidentally name the package with "share" a common word in English
that does not reflect the content of repository.
By moving to other repository, we can rename it to better and unique
name, in this "pakakeh.go".
Pakakeh is Minang word for tools, and ".go" suffix indicate that the
repository related to Go programming language.
Second, supporting open source.
The new repository is hosted under sourcehut.org, the founder is known
to support open source, and all their services are licensed under AGPL,
unlike GitHub that are closed sources.
Third, regarding GitHub CoPilot.
The GitHub Terms of Service [1], allow any public content that are hosted
there granted them to parse the content.
On one side, GitHub helps and flourish the open source, but on another
side have an issues regarding scraping the copyleft license [2].
[1]: https://docs.github.com/en/site-policy/github-terms/github-terms-of-service#4-license-grant-to-us
[2]: https://githubcopilotinvestigation.com
|
|
This implemented simplified version of merging multiple MemFS instances.
The sub file system (subfs) can be added to the parent MemFS instance
by calling new method "Merge".
parent.Merge(other *MemfS)
When Get method called, each subfs will be evaluated in order of Merge
called.
This deprecated the function Merge.
|
|
Even thought empty directory does not contains file, from the parent
node _it is_ part of their content.
Also, there is a use case where memfs use as virtual file system (VFS),
as a layer with file system, where user can view list of directory,
create a directory or file on the fly.
If we skip scanning empty directory, that directory will not be visible.
|
|
Replace ":=" with "var" and realign the field assignments.
|
|
In the next gofmt (Go v1.19), the comment format does not allow empty
lines "//" at the top and bottom of the comment.
This changes make the generated Go code from Embed method to match
as close as possible with output of gofmt.
|
|
|
|
Previously, we assume that the PathNodes from instance of MemFS is
already up to date.
If PathNodes is initialized by previous GoEmbed and the Root directory
contains new files or directories, that new files does not get
embedded.
This changes fix this issue by force re-mount the whole Root directory
before generating the Go file.
|
|
Previous commits, embed the GenFuncName into the generated Go embed file
which forgot to update the unit tests.
|
|
The original idea for option ContentEncoding in EmbedOptions and Node
is to save spaces, compressing the content on disk on embedding and
doing transport, when the MemFS instance is used to serve the (embedded)
contents of file system.
This option turns out break the HTTP content negotiation [1] of
accept-encoding header, if the HTTP server does not handle it properly,
which default Go HTTP server does not.
In order to prevent this issue in the future, for anyone who use the
memfs for serving static HTTP contents, we remove the options and store
the embedded content as is and let the HTTP server handle how the
compression by itself.
[1] https://developer.mozilla.org/en-US/docs/Web/HTTP/Content_negotiation
|
|
Since the GoEmbed can be called only when MemFS instance is initiated,
it would be better if parameters for GoEmbed also initialized in the
struct Options.
In this way any additional parameters needed to add to GoEmbed does not
changes the method signature in the future.
This commit add new type EmbedOptions that contains the parameters
for GoEmbed.
In this new type, we add new field EmbedWithoutModTime.
if its true, the modification time for all files and directories are not
stored inside generated code, instead all files will use the current
time when the program is running.
|