Skip to content

SubAlgo/checkMemberList

Repository files navigation

checkMemberList

Coverage Status Go Report Card

checkMemberList is the library helper check data in slice

Get library to your project:

go get github.com/subalgo/checkMemberList

Method available

checkMemberList.StringIn([]string, string) //check string in []string

checkMemberList.IntIn([]int, int) // check int in []int

checkMemberList.Int64In([]int64, int64) // check int64 in []int64

checkMemberList.Float32In([]Float32, Float32) // check float32 in []float32

checkMemberList.Float64In([]Float64, Float64) // check float64 in []float64

Example

package main

import (
      "fmt"
      "github.com/subalgo/checkMemberList"
)

func main() {
      var mySlice = []string{"apple", "banana"}
      res := checkMemberList.StringIn(mySlice, "banana")
      fmt.Println(res) // true

      res2 := checkMemberList.StringIn(mySlice, "mango")
      fmt.Println(res2) // false
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages