Giter Club home page Giter Club logo

GoTools

go语言开发实用工具。

Import

  • 安装

    go get github.com/hellolib/gotools
  • 引入

    import "github.com/hellolib/gotools"

Example

package main

import (
  "fmt"
  "github.com/hellolib/gotools/ternary"
)

func main() {
  fmt.Println(ternary.If(true, "true", "false"))  // true
  fmt.Println(ternary.If(false, "true", "false")) // false
  fmt.Println(ternary.If(1 > 0, 1, 0))  // 1
  fmt.Println(ternary.If(1 < 0, 1, 0))  // 0
}

Feature

    • If 三元运算
    • Chunk 将切片切分为大小为chunkSize的切片
    • SplitExecute 切片分块执行
    • SplitAsyncExecute 切片分块异步执行
    • SplitAsyncExecuteWithCtx 切片分块异步执行

小刘扎扎's Projects

goext icon goext

Go 1.18+ 基础类型扩展库:在go内置map、slice、channal等基础类型上基于泛型做一层扩展。

ollama icon ollama

Get up and running with Llama 2, Mistral, Gemma, and other large language models.

trie icon trie

Trie implemented by Go.

xin-wen-lian-bo icon xin-wen-lian-bo

新闻联播文字稿及其基于 nodejs 的爬虫源码 (利用 Github Actions 实现自动更新)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.