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

Releases: xgfone/go-tools

v7.0.0

12 May 15:33
Compare
Choose a tag to compare

Simply the package and remove the unnecessary functions.

  • Added:
    • Add the function GetAllNetIPs to get all the network ips like 127.0.0.1/8.
    • Add the default buffer pools BufferPool1k, BufferPool2k, BufferPool4k and BufferPool8k.
  • Changed:
    • Rename the function WalkDirFull to WalkDir.
    • Rename the function HandleSignalWithFunc to HandleSignalWithCallback.
    • Remove the function GetFieldTags and rename GetFieldTagsMap to GetFieldTags.
    • Remove the function GetStructTags and rename GetStructTagsMap to GetStructTags.
    • Extract the type cast from the sub-package types to the external package github.com/xgfone/cast.
    • NewBytesPool returns *BytesPool instead of BytesPool and NewBufferPool returns *BufferPool instead of BufferPool.
    • Change the type of the handler of TCPServer from func(conn *net.TCPConn, isStopped func() bool) to func(context.Context, *net.TCPConn).
  • Removed:
    • Remove the whole sub-packages option and sync2.
    • Remove the ResourcePool from the sub-package pools.
    • Remove the function ReadLine from the sub-package io2.
    • Remove the function TCPServerForever from the sub-package net2.
    • Remove the Split functions SplitXXX from the sub-package strings2.
    • Remove the function HandleSignalWithLifecycle from the sub-package signal2.
    • Remove the default buffer pool DefaultBufferPool from the sub-package pools.
    • Remove the functions GetSliceValue, PullSliceValueWithDefault, PullSliceValue, Reverse from the sub-package functions.
    • Remove the functions Type, IsExist, IsFile, IsDir, SelfPath, SelfDir, EnsureDir, MTime, Size from the sub-package file.
    • Remove the Convert, the Converter and the type cast functions, like ToXXX and MustToXXX, from the sub-package types.

v6.1.0

26 Sep 13:23
Compare
Choose a tag to compare
  • Added:
    • Cmd: Add CmdError to wrap the error returned by Cmd.
    • Cmd: Add the lock to execute the command goroutine-safely .
    • Cmd: Add the result hook ResultHook to handle the result of Cmd.
    • Set: Add the method String to print the set.
    • Set: Add the method ForEach instead of the deprecated Walk.
    • Set: Add the function NewSetFromSlices and the method AddSlices to add the elements of the slice or array into the set.
    • SMap: Add the new type SMap to wrap map[string]interface{}.
  • Changed:
    • Cmd: Change the field hooks to Hooks to export it.

v6.0.0

10 Sep 06:10
Compare
Choose a tag to compare
  • Added:
    • Support Semantic Import Versioning, and move the imported path from github.com/xgfone/go-tools to github.com/xgfone/go-tools/v6.
    • The method AppendAny of Builder supports io.WriterTo.
    • Add the default timeout for Cmd in the sub-package execution.
  • Changed:
    • Remove the sub-package errors.
    • Remove the deprecated functions and interfaces.
    • Either of the arguments in and out of RegisterChannel may be nil.

v5.13.0

05 Sep 13:01
Compare
Choose a tag to compare
  • Added:
    • lifecycle: Add the method Done() and Context() for Manager.
    • types: ToStringSlice will split the string by StringSeparator when it is not "".
  • Changed:
    • lifecycle: RegisterChannel ignores the argument in when it is nil.

v5.12.0

31 Jul 12:49
Compare
Choose a tag to compare
  • Added:
    • Add the error handler ErrHandler for net2.TCPServer.
    • Add Connection() to get the number of the connection for net2.TCPServer.
    • Add RegisterOnShutdown() to register the shutdown callback for net2.TCPServer.
  • Fix:
    • Start ends when net2.TCPServer is closed.

v5.11.1

23 Jul 01:36
Compare
Choose a tag to compare
  • Remove the limit of go 1.12.

v5.11.0

12 Jun 05:55
Compare
Choose a tag to compare
  • Added:
    • [execution] Add the field SetCmd to allow the user to customize the command.
  • Updated:
    • [types] Enhance the type coercion ToXXX() by referring to cast.
  • Deprecated:
    • [types] ToComplex128, ToMap, MustToComplex128 and MustToMap are deprecated!

v5.10.0

27 May 08:40
Compare
Choose a tag to compare
  • Added:
    • Add the error based on key-value KvError.
    • Add the command executor Cmd and add the hook feature for it.
    • string builder Builder:
      • AppendAny of the string builder supports the map and slice type.
      • Add the method AppendAnyFmt for string builder.
      • Optimize AppendJSON for []int, []string, []interface{}, map[string]string and map[string]interface{}.
  • Deprecated:
    • Byter and MarshalByter in the sub-package json2 are deprecated.

v5.9.2

23 May 02:57
Compare
Choose a tag to compare
  • Fix: Builder.AppendJSONString should use " enclose string.

v5.9.1

23 May 02:57
Compare
Choose a tag to compare
  • Fix: Builder.AppendJSON must escape the double quotation.