Skip to content
This repository was archived by the owner on Apr 1, 2023. It is now read-only.

Releases: xgfone/go-tools

v5.9.0

22 May 09:42
Compare
Choose a tag to compare
  • Added:
    • Add the string builder Builder.
    • ToBytesErr supports the type encoding.TextMarshaler.
  • Changed:
    • RunCmd will get the error from stderr or stdout preferentially.

v5.8.0

17 May 07:21
Compare
Choose a tag to compare
  • Added:
    • Add the new sub-pakcage json2 to marshal json.
    • Add new string functions WriteString and SafeWriteString.
    • Add new format functions FmtStringByFunc and FmtStringOutput, and the methods FormatOutput and FormatByFunc of Format.

v5.7.0

15 May 02:31
Compare
Choose a tag to compare
  • Added:
    • Add the functions GetStructTagsMap and GetFieldTagsMap to get the struct field tags as the map type.
    • Add the string formatter Format, FmtString and FmtStringByMap.
  • Changed:
    • Move the string splitting functions to the independent sub-package strings2.

v5.6.0

11 Apr 07:28
Compare
Choose a tag to compare
  • Add the TCP server TCPServer, which can be started and stopped gracefully.
  • Add the new executor RetryRunCmd to retry executing the command once again if failed.

v5.5.2

29 Mar 10:35
Compare
Choose a tag to compare
  • Fix a time converting error.

v5.5.1

26 Mar 06:36
Compare
Choose a tag to compare
  • The number converting functions, such as ToInt64 and ToFloat64, support the type []byte as string. So for the typed option.Option, such as Float64Option, you can scan it as the value.

v5.5.0

26 Mar 04:08
Compare
Choose a tag to compare
  • Add .travis.yml and the build status.
  • Add the type LocalTime option.
  • Add the method PrefixRegister for lifecycle manager to register the callback function before others.
  • Allow ToTime and ToLocalTime to parse the empty string and []byte.

v5.4.0

26 Mar 03:25
Compare
Choose a tag to compare
  • Add the converting function ToLocalTime and MustToLocalTime.
  • Unify the implementation of ToTime and ToLocalTime, and both of them support the type of []byte and the zero value "0000-00-00 00:00:00".
  • Simply the implementation of the methods Scan and UnmarshalJSON.

v5.3.0

13 Mar 15:23
Compare
Choose a tag to compare
  • Add go.mod.
  • Add the time.Time option TimeOption.
  • Add the error ErrUnknownType for the sub-package types.
  • Change: the ToXXX returns ErrUnknownType for the invalid type.
  • Update: Option supports json.Marshaler, and the typed Option also supports json. Unmarshaler.
  • Update: the Time converter supports "0000-00-00 00:00:00".

v5.2.0

07 Mar 08:02
Compare
Choose a tag to compare
  • Add the LICENSE header.
  • Add the new binding functions SetValue, SetStructValue, SetStructValueOf and BindMapToStruct.
  • Add the new converting functions ToInt8, ToUint8, ToInt16, ToUint16, MustToInt8, MustToUint8, MustToInt16, MustToUint16.
  • ToBool supports yes as true and no as false.
  • Optimize the lifecycle manager:
    • Change: call the registered stop functions by the reverse.
    • Allow Register to add many functions.
    • Add the methods Exit.