473,288 Members | 2,350 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes and contribute your articles to a community of 473,288 developers and data experts.

lancet (util function library of go) released v2.0.0, fully supports go generic features

lancet is a comprehensive, efficient, and reusable util function library of go. This release v2.0.0, which upgrade to go1.18, applies generics to rewrite most of the functions. At the same time, 70+ functions have been added.

Feature

- 👏 Comprehensive, efficient and reusable.
- 💪 250+ go util functions, support string, slice, datetime, net, crypt...
- 💅 Only depend on the go standard library.
- 🌍 Unit test for every exported function.

Installation
Note:

1. For users who use go1.18 and above, it is recommended to install lancet v2.x.x. Cause v2.x.x rewrite all functions with generics of go1.18.

go get github.com/duke-git/lancet/v2 // will install latest version of v2.x.x


2. For users who use version below go1.18, you should install v1.x.x. now latest v1 is v1.2.9.

go get github.com/duke-git/lancet@v1.2.9 // below go1.18, install latest version of v1.x.x


Usage

Lancet organizes the code into package structure, and you need to import the corresponding package name when use it. For example, if you use string-related functions,import the strutil package like below:

import "github.com/duke-git/lancet/v2/strutil"


Example

Here takes the string function ReverseStr (reverse order string) as an example, and the strutil package needs to be imported.


Expand|Select|Wrap|Line Numbers
  1. package main
  2.  
  3. import (
  4.     "fmt"
  5.     "github.com/duke-git/lancet/v2/strutil"
  6. )
  7.  
  8. func main() {
  9.     s := "hello"
  10.     rs := strutil.ReverseStr(s)
  11.     fmt.Println(rs) //olleh
  12. }
Link to API Documentation
Apr 15 '22 #1
0 8223

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: sebor | last post by:
Hi all, The latest release of the Rogue Wave C++ Standard Library, version 4.1.0, has just been released into public domain under the Apache License, version 2.0, as the Apache stdcxx project:...
6
by: Tera | last post by:
can you please give me a link ?
3
by: Chris Jackson | last post by:
In clasic asp you could have some include files that had all your common functions in them so you could include them in your application by <! Include ing them. Ok - Im new to asp.net - im...
6
by: Paul M. | last post by:
Hello, does anyone have either a User Function Library (or the source for one) to create a CRC32 checksum for a given string? I want to use the function in a crystal formula thus: formula =...
0
by: Carlos Lozano | last post by:
Hello, I am converting a MS Access application into ASP.NET. It has a many CR reports that calls external functions in a VBA library. I have been trying to create a user Function Library (UFL)...
2
by: mirandacascade | last post by:
I am prompted to make these inquiries after seeing the following link to ctypes: http://docs.python.org/lib/module-ctypes.html in which ctypes is described as a foreign function library. ...
1
by: rich_sposato | last post by:
I released version 2.0 of C++ Unit Test Library. You can download it from SourceForget.Net at http://sourceforge.net/projects/cppunittest/ .. I wrote this unit test library because other unit...
1
by: £ukasz | last post by:
I have project that uses managed c++ where I use c - library, this library contains some variables named generic, during compilation I get error: Error 1 error C2146: syntax error : missing ';'...
0
by: info | last post by:
Cognaxon has released "NIST (ANSI/NIST-ITL 1-2000) library" which adds the power of NIST (ANSI/NIST-ITL 1-2000) file format to your software projects using only a few lines of code. Additionally...
0
by: lanliddd | last post by:
Lancet is a comprehensive, efficient, and reusable util function library of go. Inspired by the java apache common package and lodash.js. Go version Release GoDoc Go Report Card codecov License ...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.