| Age | Commit message (Collapse) | Author |
|
|
|
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
|
|
The realign save storage spaces on struct,
* Node: from 240 to 224 bytes (-16 bytes)
* Options: from 112 to 104 bytes (-8 bytes)
* PathNode: from 16 to 8 bytes (-8 bytes)
|
|
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
|
|
One of the hardest when multiple packages is used is to detect where
there error happened. For example, if a program return an error io.EOF,
it's hard to detect the exact method or function that caused its,
especially when processing multiple files with network connection.
|
|
Previously we use the "testdata" for output of Node.Save() test.
This is caused the modified time on "testdata" get changes every
time we run the test and cause the embed_test failed.
This changes use temporary directory and revert part of Node Save()
unit test from commit 792ba17ac1f.
|
|
The reason why the field named V is because it's short. It's come
from my C/C++ experience that got carried away when writing this
package.
Now, after having more time writing Go, I prefer clarity over
cleverity(?).
|
|
|
|
The Save method will write the new content to file system and update
the content of Node using Encode().
|
|
Previously, the test.Assert and test.AssertBench functions has the
boolean parameter to print the stack trace of test in case its not equal.
Since this parameter is not mandatory and its usually always set to
"true", we remove them from function signature to simplify the call
to Assert and AssertBench.
|
|
The field WithContent is not necessary if we set MaxFileSize to negative
value.
|
|
Previously, the generated Go code from memfs can be used only once
on the package that use it. For example, if we have two instances of
memfs.MemFS and both of them call GoGenerate(), when we load them back
again only the last one will be active and set the global variable
memfs.GeneratedPathNode.
This changes refactoring on how we use memfs by storing the
generated path node into variable that is defined by user and pass
them to New Options.
This changes affect package http and io.
|
|
|
|
This changes add parameter directory to be mounted in New(), so user
did not need to call Mount manually
This cause the Mount method and its sibling, Unmount and IsMounted
become unneeded, so we remove them.
|
|
|
|
|
|
|
|
|
|
|