| Age | Commit message (Collapse) | Author |
|
Go 1.22 now support for-range on numeric value.
|
|
Since Go 1.20, the standard bytes package have the Copy function.
Since Go 1.22, the standard slices package have the Concat function.
|
|
By exporting the field, this allow the caller to filter or manage the
Header Fields manually.
|
|
After the header and body has been parsed, if the header contains
Content-Transfer-Encoding, we decode the body into its local formats.
Currently supported encoding is "quoted-printable" and "base64".
|
|
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.
|
|
Instead of annotating the lines that caught by linters, fix it to comply
with the recommendations.
This causes several breaking changes, especially related to naming,
* api/slack: [Message.IconUrl] become [Message.IconURL]
* lib/dns: DefaultSoaMinumumTtl become DefaultSoaMinimumTTL
* lib/email: [Message.SetBodyHtml] become [Message.SetBodyHTML]
* lib/http: [Client.GenerateHttpRequest] become
[Client.GenerateHTTPRequest]
* lib/http: [ClientOptions.ServerUrl] become [ClientOptions.ServerURL]
* lib/http: [EndpointRequest.HttpWriter] become
[EndpointRequest.HTTPWriter]
* lib/http: [EndpointRequest.HttpRequest] become
[EndpointRequest.HTTPRequest]
* lib/http: [ServerOptions.EnableIndexHtml] become
[ServerOptions.EnableIndexHTML]
* lib/http: [SSEConn.HttpRequest] become [SSEConn.HTTPRequest]
* lib/smtp: [ClientOptions.ServerUrl] become [ClientOptions.ServerURL]
* lib/ssh/sftp: [FileAttrs.SetUid] become [FileAttrs.SetUID]
* lib/ssh/sftp: [FileAttrs.Uid] become [FileAttrs.UID]
|
|
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
|
|
There are some reports that I disagree with revive, in example, code
should not declare the type after variables.
In my opinion, on some cases, declaring the type make the code more
readable and explicit.
Since I did not want to add new configuration file, we changes it and
follow revive for now.
|
|
Using string provide safety, guaranteed that if we pass it as parameter
the receiver will not be able to modify its content.
|
|
|
|
Since Go 1.16, the ioutil package has been deprecated.
This changes replace any usage that use functions from ioutil package
with their replacement from package os or package io.
|
|
Calling Pack now set the Date header if its not exist, using the local
time; and the message-id header if its not exist using the following
format:
<epoch>.<random-8-chars>@<local-hostname>
The random-8-chars is Seed-ed from Epoch(), so does the boundary.
|
|
Previouly, the Pack method generate multipart/alternative message only.
Since the Message now can set the body text and HTML, without using
NewMultipart, the Pack method need to be able to accomodate this.
|
|
Previously, we skip the test on NewMultipart because it use a random
number generator to generate boundary.
This changes make the test predictable by setting the Epoch and date
to always in UTC, so anyone who run test on the package run without
fail.
|
|
Previously, a Message can be created only using NewMultipart, which
generate message with text and HTML.
This changes add methods to compose a Message: AddCC, AddTo, SetBodyHtml,
SetBodyText, SetCC, SetFrom, SetSubject, and SetTo.
|
|
The idea is to minimize GC pressure on system with many messages,
minimize checking for nil value, and make an empty Message ready to use
without any initialization.
|
|
The Date field value is set to current time on the system that
generated the message.
The date format is set to "Mon, 2 Jan 2006 15:04:05 -0700" according
to RFC 5322 section 3.3.
|
|
The NewMultipart() function create new email message using primary
fields "from", "to", "subject" with content-type is set to
"multipart/alternative".
|
|
|
|
Non pointer slice is less confusing than with pointer.
|
|
Everything seems like works in order, we need more test will real life
message.
|
|
|
|
Each message will have DKIMSignature field and dkimStatus that contains
the message signature, if available, and their status.
|
|
The two methods are simple or relaxed algorithm as defined in RFC 6376,
section 3.4.3 and 3.4.4
|
|
|
|
|