aboutsummaryrefslogtreecommitdiff
path: root/Makefile
AgeCommit message (Collapse)Author
2026-01-26make: increase test timeout to 2m due to lib/email/dkim takes more 60sShulhan
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.
2026-01-03all: use SPDX license header formatShulhan
2025-01-26lib/goanalysis: package to complement "go vet"Shulhan
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.
2025-01-22make: do not ignore error when running "go vet"Shulhan
2024-09-13all: replace golangci-lint with 'got vet'Shulhan
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.
2024-09-04all: fix various linter warningsShulhan
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.
2024-03-14test/httptest: new helper for testing HTTP server handlerShulhan
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].
2024-03-09Makefile: reorder default tasks and add flags for reproducible buildShulhan
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
2024-03-06all: conform with linter gosec, ineffasign, and makezeroShulhan
Some of warnings from those linter are false positives, so we just annotated them.
2024-03-05all: comply with linter recommendations #3Shulhan
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.
2024-03-05all: comply with linter recommendations #2Shulhan
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.
2024-03-02all: move the repository to "git.sr.ht/~shulhan/pakakeh.go"Shulhan
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
2023-09-14Makefile: replace golangci-lint with reviveShulhan
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.
2023-02-25all: set the test timeout to 1mShulhan
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.
2023-02-25all: move the AUR packaging files into directory _AURShulhan
2022-08-05all: simplify and remove unused tasks in MakefileShulhan
2022-07-27all: add PKGBUILD for shared tools in cmdShulhan
The PKGBUILD create Arch package named share-tools. Its include command epoch, ini, and xtrk.
2022-07-27all: make the share.Version in the command to be dynamicShulhan
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.
2022-07-27make: cleaning up and simplify MakefileShulhan
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.
2021-10-09Makefile: add -failfast and remove -p=1 on go test flagsShulhan
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.
2021-03-14Makefile: remove any cover.html and cover.out on task "clean"Shulhan
2021-02-21all: use the ciigo binary instead of library to generate docsShulhan
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.
2021-02-10Makefile: run the test coverage using one CPUShulhan
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.
2020-12-06all: replace the tasks to serve and generate docs using ciigo as libraryShulhan
This way, one does not need to install ciigo binary, only require Go tools.
2020-11-09Makefile: rename taks `genhtml` to `docs` and add task to serve the docsv0.20.1Shulhan
2020-06-06all: use default linter optionsShulhan
2020-05-16all: fix and suppress linter warningsShulhan
2020-05-14Makefile: disable "testpackage" linterShulhan
2020-05-08all: rename directory "doc" to "_doc"Shulhan
This is to prevent the directory being processed by Go tools.
2020-04-11Makefile: add more phony tasksShulhan
2020-03-02CHANGELOG: update and create symlinks inside docShulhan
2020-02-13Makefile: disable unnecessary linters on lint taskShulhan
2019-10-03Makefile: disable "funlen" and "godox" lintersShulhan
2019-09-27Makefile: add task to generate HTML files from asciidoc filesShulhan
2019-03-02all: suppress "dupl" linter warnings on test filesShulhan
2018-11-30all: fix and suppress linter warnings on long linesShulhan
2018-11-30all: minimize and suppress linter warnings for global variablesShulhan
2018-08-23lib/dns: Implement DNS server with handlerShulhan
2018-08-22[test] make: enable race option when running testShulhan
2018-08-19Fix typo on make fileShulhan
2018-07-06Add implementation of websocket server and client (RFC 6455)Shulhan
2018-06-02make: Replace gometalinter with golangci-lintShulhan
2018-05-18make: add task for clean and distcleanShulhan
2018-05-18Add make fileShulhan