| Age | Commit message (Collapse) | Author |
|
Just for record, with 1m timeout, it will cause the following error,
----
panic: test timed out after 1m0s
running tests:
TestSignatureSign (0s)
goroutine 8 [running]:
testing.(*M).startAlarm.func1()
/home/ms/local/share/go/src/testing/testing.go:2806 +0x605
created by time.goFunc
/home/ms/local/share/go/src/time/sleep.go:215 +0x45
goroutine 1 [chan receive]:
testing.(*T).Run(0xc000148488, {0x82e9cf, 0x11}, 0xb1eed8)
/home/ms/local/share/go/src/testing/testing.go:2109 +0xb3e
testing.runTests.func1(0xc000148488)
/home/ms/local/share/go/src/testing/testing.go:2589 +0x86
testing.tRunner(0xc000148488, 0xc00013dab0)
/home/ms/local/share/go/src/testing/testing.go:2036 +0x21d
testing.runTests({0x83415e, 0x1d}, {0x83b055, 0x2c}, 0xc000016588, {0xb7aee0, 0x14, 0x14}, {0xc255bab7b14073ac, 0xdf8581351, ...})
/home/ms/local/share/go/src/testing/testing.go:2587 +0xb18
testing.(*M).Run(0xc00014a460)
/home/ms/local/share/go/src/testing/testing.go:2443 +0xf45
main.main()
_testmain.go:94 +0x165
goroutine 24 [runnable]:
crypto/internal/fips140/bigmod.(*Nat).montgomeryMul(0xc000298da8?, 0xc0002996e8?, 0xc000298da8?, 0xc000065cc0?)
/home/ms/local/share/go/src/crypto/internal/fips140/bigmod/nat.go:779 +0xab8
crypto/internal/fips140/bigmod.(*Nat).Exp(0xc0002996e8, 0xc000299700, {0xc0000254c0, 0x40, 0xc000065ca0?}, 0xc000065cc0)
/home/ms/local/share/go/src/crypto/internal/fips140/bigmod/nat.go:1028 +0xa57
crypto/internal/fips140/rsa.decrypt(0xc00001a2a0, {0xc00006f300, 0x80, 0x80}, 0x1)
/home/ms/local/share/go/src/crypto/internal/fips140/rsa/rsa.go:428 +0x466
crypto/internal/fips140/rsa.signPKCS1v15(0xc00001a2a0, {0x82a7e6, 0x5}, {0xc00001f4a0, 0x14, 0x14})
/home/ms/local/share/go/src/crypto/internal/fips140/rsa/pkcs1v15.go:60 +0xc5
crypto/internal/fips140/rsa.SignPKCS1v15(0xc00001a2a0, {0x82a7e6, 0x5}, {0xc00001f4a0, 0x14, 0x14})
/home/ms/local/share/go/src/crypto/internal/fips140/rsa/pkcs1v15.go:51 +0x259
crypto/rsa.SignPKCS1v15({0xc0002999b8?, 0x45b525?}, 0xc00001a230, 0x3, {0xc00001f4a0, 0x14, 0x14})
/home/ms/local/share/go/src/crypto/rsa/fips.go:353 +0x289
git.sr.ht/~shulhan/pakakeh.go/lib/email/dkim.(*Signature).Sign(0xc000299db0, 0xc00001a230, {0xc00001f4a0, 0x14, 0x14})
/home/ms/kilabit.info/_project/src/pakakeh.go/lib/email/dkim/signature.go:281 +0x192
git.sr.ht/~shulhan/pakakeh.go/lib/email/dkim.TestSignatureSign(0xc00017a908)
/home/ms/kilabit.info/_project/src/pakakeh.go/lib/email/dkim/signature_test.go:354 +0x62c
testing.tRunner(0xc00017a908, 0xb1eed8)
/home/ms/local/share/go/src/testing/testing.go:2036 +0x21d
created by testing.(*T).Run in goroutine 1
/home/ms/local/share/go/src/testing/testing.go:2101 +0xb13
FAIL git.sr.ht/~shulhan/pakakeh.go/lib/email/dkim 60.085s
----
I think it is related to fips140 has been merged to the go tip that
increase the time.
|
|
|
|
Package goanalysis implement go static analysis using
[Analyzer] that are not included in the default "go vet", but included in
the [passes] directory, including: fieldalignment, nilness,
reflectvaluecompare, shadow, sortslice, unusedwrite, and waitgroup.
This package is not mean to be imported directly by other package
except main, like we have in [cmd/gocheck].
The rest (and previous) of the changes are affect running gocheck on it.
|
|
|
|
This is the second time the golangci-lint does not work using go tip.
We also found that running golangci-lint on VM with 8GB cause the program
crash with out of memory.
|
|
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.
|
|
The Simulate function simulate HTTP server handler by generating
[http.Request] from fields in [SimulateRequest]; and then call
[http.HandlerFunc].
The HTTP response from serve along with its raw body and original HTTP
request then returned in [*SimulateResult].
|
|
The lint and build should be the first tasks, so in case we have warnings
or errors the tests are not running.
The flags for reproducible build are taken from Arch Linux wiki [1].
[1]: https://wiki.archlinux.org/title/Go_package_guidelines#Flags_and_build_options
|
|
Some of warnings from those linter are false positives, so we just
annotated them.
|
|
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.
|
|
HTTP request now implicitly create request with context.
Any false positive related to not closing HTTP response body has been
annotated with "nolint:bodyclose".
In the example code, use consistent "// Output:" comment format, by
prefixing with single space.
Any comment on code now also prefixing with single space.
An error returned without variables now use [errors.New] instead of
[fmt.Errorf].
Any error returned using [fmt.Errorf] now wrapped using "%w" instead of
"%s".
Also, replace error checking using [errors.Is] or [errors.As], instead
of using equal/not-equal operator.
Any statement like "x = x OP y" now replaced with "x OP= y".
Also, swap statement is simplified using "x, y = y, x".
Any switch statement with single case now replaced with if-condition.
Any call to defer on function or program that call [os.Exit], now
replaced by calling the deferred function directly.
Any if-else condition now replaced with switch statement, if possible.
|
|
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 golangci-lint become unusable.
Even running "make" on the their master branch does not works.
Since I use go tip (master) on local, sometimes golangci-lint does not
run.
This changes replace golangci-lint with go vet, fieldalignment and shadow
from x/tools, and revive.
|
|
Some flaky test, caused by waiting for channel, require waiting for 10m
before it considered fail.
This changes we cut the default timeout to 1 minute.
|
|
|
|
|
|
The PKGBUILD create Arch package named share-tools.
Its include command epoch, ini, and xtrk.
|
|
Instead of using only the last tagged version use the last tag
plus latest commit hash.
This changes require the Version and other constants that use it
to be declared as variable.
|
|
Add new task: "build" to build all cmd into _bin/linux-amd64
directory.
Set the default "all" task to test, lint, and then build.
Remove the $SRC and $SRC_TEST to minimize disk read, let the Go
figure it out if the package need to be build and/or test.
|
|
The -failfast option prevent the next test running when the current
test is fail.
The -p=1 limit the number of test running in parallel. Since we believe
that all of test cases are indepents, we remove this field.
|
|
|
|
Previously, we use the ciigo as library to convert and server the
internal documentation. This cause circular dependencies in go.mod
where ciigo depends on share module and share module depends on ciigo.
There is nothing wrong with that and everything seems working fine, until
we need to use "replace" to test the changes on share module from ciigo
module.
This changes remove the use of ciigo library through
internal/cmd/docs-serve and internal/cmd/docs and replace them by
calling the ciigo binary directly.
|
|
This is to make the test result stable on flaky unit test that require
waiting for server to run on TestMain before executing the test functions.
|
|
This way, one does not need to install ciigo binary, only require Go
tools.
|
|
|
|
|
|
|
|
|
|
This is to prevent the directory being processed by Go tools.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|