473,416 Members | 1,868 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,416 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 8232

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 ...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.