| Age | Commit message (Collapse) | Author |
|
Display the invalid character in the error message with quote, so space
can detected.
Also, export the error variable so external caller can detect it using the
variable.
|
|
For HTTP server that use TLS, set the minimum TLS version and
ReadHeaderTimeout to mitigate slowloris attack.
For HTTP client or server that parameterize the use of InsecureSkipVerify,
annotate the line with "nolint:gosec" to allow the code pass the check.
Library that still use sha1, in example in DKIM and TOTP, skip the
warnings by annotating the line with "nolint:gosec".
A pointer variable now allocated their address before assigning its
value.
Any error that returned now wrapped using "%w".
Also, replace error checking using [errors.Is] or [errors.As] instead of
using equal or not-equal operators.
In "lib/http", replace any usage of "math/rand" with "crypto/rand".
Any call of [math/big.Rat.SetString] now annotated with "nolint:gosec"
since its false positive, the issue has been fixed in Go >= 1.17.7.
Any switch case that does not cover the rest of the possible values now
handled by adding the cases or by replacing the "default" case with
the rest of values.
|
|
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
|
|
Multi line values without spaces should not add any space in between.
|
|
Previously, if INI file contains multi line variables, for example
key = a \
b
The Get and saved value is "a \tb", where it should be "a b" for Get and
"a \\\n\t\b" again when saved.
This changes require refactoring how the variable's value is parsed and
stored.
A variable value is parsed and stored from character after "=" until new
line or comment as raw value, and the real value is derived by trimming
white spaces, handle escaped character and double quotes.
|
|
Previously, the comment is parsed and stored separately.
This changes make the comment as part of format.
|
|
Changes,
* reader: from 184 to 168 bytes (-16 bytes)
* Section: from 104 to 88 bytes (-16 bytes)
* structField: from 120 to 112 bytes (-8 bytes)
* variable: from 120 to 104 bytes (-16 bytes)
|
|
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.
|
|
In Git specification, an empty variable is equal to boolean true.
This cause inconsistency between empty string and boolean true.
This changes make the empty value become an empty string instead of
boolean true.
|
|
|
|
Previously, a variable end with "=" will have value set to "true".
For example,
[section]
var =
will set the "var" value to string "true".
This changes make the variable that end with "=" without any value
to be an empty string, so "var" value is equal to "".
|
|
This is the third part of refactoring ini package. The change affect
on how variable value being fetched and formatted.
|
|
This is the second part of refactoring to provide clean and readable
code.
|
|
This is the first part to refactoring ini package to provide a clean
and simple API.
|
|
Instead of using reader, call the new function Parse(), to parse INI
formatted text.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Previous benchmark result (22dcd07 Move buffer to reader),
BenchmarkParse-2 500 19534400 ns/op 4656335 B/op 81163 allocs/op
New benchmark result,
BenchmarkParse-2 20000 71120 ns/op 35368 B/op 549 allocs/op
|
|
|
|
Package ini implement reading and writing INI configuration as defined by
Git configuration file syntax [1].
[1] https://git-scm.com/docs/git-config#_configuration_file
|