github.com/iEvan-lhr/exciting-tool@v0.0.0-20230504054234-8e983f73cdd2/README-CN.md (about)

     1  # exciting-tool
     2  
     3  [![Hex.pm](https://img.shields.io/hexpm/l/plug.svg)](https://opensource.org/licenses/Apache-2.0)
     4  
     5  [English](./README.md) | [简体中文](./README-CN.md)
     6  
     7  exciting-tool 是一个理想化的全能的 Go 的工具包,涉及的内容包括:字符串的处理(拼接、转换等等)、结构体的日志遍历(示例)、原生sql的自动拼接与处理、更方便的map(开发中)、json解析、http请求发送等等。
     8  
     9  
    10  ## 备注信息
    11  
    12  这是一个完全开源的项目。
    13  
    14  作者并不能保证能及时更新内容,但会尽力去完善文档来帮助使用者来使用。
    15  
    16  也欢迎大家帮助我 :heart::heart::heart:
    17  
    18  ## 重要提示  ⚠⚠⚠⚠⚠
    19  
    20  
    21  ☠ 需要GO版本1.18或更多 ☠
    22  
    23  ☀ 您可以在低版本中使用Lowversion分支的代码 ☀
    24  
    25  某些功能可能不安全,并且某些功能仅在GO原生代码中修改。因此,请注意实际使用中某些功能的使用。在可能的问题上,我会尽可能地标记。
    26  
    27  ## 如何使用
    28  
    29  ```bash
    30     go get github.com/iEvan-lhr/exciting-tool
    31  ```    
    32  ## 全功能 String  
    33  
    34  使用这段代码来构造全功能String
    35  
    36  ```bash
    37      tools.Make(str)
    38  ```  
    39  
    40  ### 相同的入参支持
    41  
    42  ✔以下方法支持使用String,全功能String,[]byte 作为入参,部分支持rune作为入参
    43  
    44  ```plain
    45  
    46  Function:
    47    Index(str any)           The next bid search, while supporting the Rune type retrieval
    48    Append(join any)         Add content to the string to support adding 
    49                             all basic types and extension basic types 
    50                             (including int, float, BOOL, int32, int16, string, str, byte, [] byte ...). 
    51                             Can be added (PS: pointer is passed in)
    52    Make(obj any)            If the structure is used to construct and the structure 
    53                             does not implement the String () method,
    54                             the full attribute printing will be performed. 
    55                             The example is as follows:
    56                             ----------User----------
    57                             Id:23132
    58                             Username:foo
    59                             Password:bar
    60                             Identity:324213
    61                             QrCode:982j32
    62                             DenKey:ansssss
    63                             TalkingKey:qwesad
    64                             ----------END----------
    65    FirstUpper()
    66    FirstLower()
    67    Check(str any)
    68    RemoveLastStr(lens)
    69    RemoveIndexStr(lens)
    70    Spilt(str any)
    71    CheckIsNull()
    72  
    73  ```
    74  
    75  ## Error treatment
    76  
    77  ```plain
    78  
    79  Function:
    80    ReturnValueByTwo()       The return value after the automatic processing, 
    81                             if the error is not empty, will panic(err)
    82    ReturnValue()            The return value after the automatic processing, 
    83                             if the error is not empty, will log(err)
    84    ExecGoFunc()             The error task that can be automatically defined in the asynchronous 
    85                             execution method internally is the asynchronous
    86                             execution of the error task that may occur
    87    ExecError()
    88    PanicError()
    89    logError()
    90  
    91  ```