| Age | Commit message (Collapse) | Author |
|
This release deprecated lib/io and lib/parser.
=== Breaking changes
* lib/reflect: remove the third return value from Marshal
* lib/bytes: changes the DumpPrettyTable output format
=== New features
* lib/os: merge some functions from lib/io
* lib/strings: merge lib/parser here
* lib/bytes: implement function ParseHexDump
* lib/bytes: implement tokenize Parser
* lib/bytes: add function TrimNull
* lib/net: add method WriteTo to ResolvConf
=== Enhancements
* lib/time: calculate the next event before notify the user on Scheduler run
* lib/reflect: add option to skip processing struct field in Do/IsEqual
=== Chores
* lib/reflect: use doEqual inside IsEqual
* lib/time: replace lib/io#Reader with lib/bytes#Parser
* lib/smtp: replace lib/io#Reader with lib/bytes#Parser
* lib/dns: replace lib/io#Reader with lib/bytes#Parser
* lib/http: replace lib/io#Reader with lib/bytes#Parser
* lib/email: replace lib/io#Reader with lib/bytes#Parser
* email/dkim: replace lib/io#Reader with lib/bytes#Parser
* lib/hunspell: replace lib/io with lib/os
* lib/hunspell: replace lib/parser with lib/strings
* lib/http: replace lib/parser with lib/strings
* lib/bytes: copy TokenFind to internal/bytes#TokenFind
|
|
This allow user to call the Next method, to know the next time the
scheduler will be triggered, after receiving the event.
|
|
Package name in test Example should be different with the actual package.
This is to minimize leaking un-exported function or method in Example
test.
|
|
Previously, IsEqual internally use isEqual, which have the same logic as
doEqual.
This changes minimize duplicate code between IsEqual and DoEqual, by
calling doEqual for both of functions.
|
|
A struct's field tagged with `noequal:""`, its value will not be
processed for equality.
|
|
The third, boolean, return value is redundant with the second error value.
|
|
|
|
Using an example not only test the code but also provide example snippet
when opened in the godoc.
|
|
Package name in test Example should be different with the actual package.
This is to minimize leaking un-exported functions or methods.
|
|
Package name in test Example should be different with the actual package.
This is to minimize leaking un-exported functions or methods.
|
|
Also, mention the deprecation in the README along with lib/parser.
|
|
The lib/io package will be deprecated in the future.
|
|
The lib/io#Reader will be deprecated and replaced with lib/bytes#Parser
in the future.
|
|
The lib/io#Reader will be deprecated and replaced with lib/bytes#Parser
in the future.
|
|
The lib/io#Reader will be deprecated and replaced with lib/bytes#Parser
in the future.
|
|
The ReadLine method read until it found new line ('\n') or end of content,
ignoring all delimiters.
The returned line will not contain '\n'.
|
|
The libio.Reader will be deprecated and replaced with libbytes.Parser
in the future.
|
|
|
|
The libio.Reader will be deprecated and replaced with libbytes.Parser
in the future.
|
|
The libio.Reader will be deprecated and replaced with libbytes.Parser
in the future.
|
|
The Remaining method return the copy of un-parsed content.
|
|
The libio.Reader will be deprecated and replaced with libbytes.Parser
in the future.
|
|
The libio.Reader will be deprecated and replaced with libbytes.Parser
in the future.
|
|
The libio.Reader will be deprecated and replaced with libbytes.Parser
in the future.
|
|
The libio.Reader will be deprecated and replaced with libbytes.Parser
in the future.
|
|
The libio.Reader will be deprecated and replaced with libbytes.Parser
in the future.
|
|
The AddDelimiters method add another delimiters to the current parser.
The ReadNoSpace method read the next token by ignoring the leading spaces,
even if its one of the delimiter. The returned token will have no
trailing spaces.
The RemoveDelimiters method remove delimiters delims from current
delimiters.
The Reset method set all internal state to new content and
delimiters.
The SetDelimiters method replace the current delimiters with delims.
The SkipHorizontalSpaces method skip space (" "), tab ("\t"), carriage
return ("\r"), and form feed ("\f") characters; and return the first
non-space character or 0 if it reach end-of-content.
The SkipSpaces method skip all spaces character
(' ', '\f', '\n', '\r', '\t') and return the first non-space character
or 0 if it reach end-of-content.
The Stop method stop the parser, return the remaining unparsed content
and its last position, and then call Reset to reset the internal state
back to zero.
The UnreadN method unread N characters and return the character its
pointed to. If N greater than current position index, it will reset the
read pointer index back to zero.
|
|
Function Copy in lib/io has been deprecated.
|
|
|
|
Functions like Copy, IsBinary, IsDirEmpty, IsFileExist, RmdirEmptyAll
are read and operate on file and directory on operating system level, so
it is not correct to put it in package io.
|
|
The lib/parser has been deprecated.
|
|
The lib/parser has been deprecated.
|
|
|
|
The first idea of parser is to provide generic parser for both bytes and
string.
After we introduce lib/parser there is not much changes to that package.
Also, since we create another Parser in lib/bytes that accept and
return token as []byte, the lib/parser is not unique anymore.
The following function/methods changes to minimize conflict in the future,
* Lines become LinesOfFile
* New become NewParser
* Open become OpenForParser
* Token become Read
* TokenEscaped become ReadEscaped
* TokenTrimSpace become ReadNoSpace
|
|
The ParseHexDump parse the default output of [hexdump](1) utility from
parameter in back into stream of byte.
An example of default output of hexdump is
0000000 7865 5f70 6964 2f72 0000 0000 0000 0000
0000010 0000 0000 0000 0000 0000 0000 0000 0000
*
0000060 0000 0000 3030 3030 3537 0035 3030 3130
The first column is the address and the rest of the column is the data.
Each data column is 16-bit words in big-endian order, so in the above
example, the first byte would be 65, second byte is 78 and so on.
The asterisk "*" means that the address from 0000020 to 0000050 is equal to
the previous line, 0000010.
[hexdump]: https://man.archlinux.org/man/hexdump.1
|
|
The Parser type parse stream of byte using one or more delimiters as
separator between token.
|
|
The TrimNull function remove 0 value ("\0" or NULL in C) at leading
and trailing of input.
|
|
Instead of comparing the Sprintf value, compare the expected and got
directly.
|
|
The change is to accommodate large bytes data, more than 0xFFFF.
The hex address in the first column is increased to 8 digits, the
characters compacted without space in between.
|
|
This is to prevent import cycle later when we use lib/test in bytes.
|
|
The WriteTo method write the ResolvConf as text.
|
|
This release set the Go version to 1.19.
=== Breaking changes
* lib/net: changes the PopulateQuery logic
=== New features
* _bin: add shell script go-test-lint.sh to run test and lint sequentially
* lib/bytes: add function DumpPrettyTable
* lib/bytes: add function SplitEach
* lib/dns: add function ParseZone
* lib/dns: add method WriteTo to Zone
* lib/http: add function to parse multipart Range response for Client
* lib/http: add support for HTTP Range in Server
* lib/io: add method ReplaceAll on Reader
* lib/parser: add method TokenTrimSpace
* lib/parser: add method SetDelimiters
* lib/telemetry: new package for collecting and forwarding metrics
=== Bug fixes
* lib/dns: fix packing, parsing, and saving MINFO resource data
* lib/dns: fix packing and unpacking resource record HINFO
* lib/dns: fix parsing SRV record from zone file
=== Enhancements
* lib/dns: allow parsing TXT rdata without quote in zone file
* lib/dns: handle zone file with CRLF line ending
* lib/test: simplify the string diff output from Assert
|
|
The following libraries has been added and not recorded,
* lib/mlog
* lib/os
* lib/ssh/config
* lib/telemetry
* lib/test/mock
|
|
|
|
|
|
We use mlog so the user of telemetry can have record of error.
|
|
We use the mlog, so user that also use mlog can record the error.
|
|
If the range is "x-y-", the function should skip the position.
|
|
|
|
Previously, PopulateQuery only add the passed dname if the number of dots
is greater than 0.
After inspecting the result from dig and getenv, the dots seems does not
affect the query.
For example, if we have A record for domain "kilabit", both of those tools
query name "kilabit" without adding local domain or domain in search.
|