basiccheck

package
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 1, 2021 License: MIT Imports: 1 Imported by: 1

Documentation

Overview

Example
package main

import (
	"fmt"

	"github.com/jeremmfr/go-utils/basiccheck"
)

func main() {
	sliceOfString := []string{"foo", "bar"}

	if basiccheck.StringInSlice("bar", sliceOfString) {
		fmt.Printf("bar found in %v", sliceOfString)

	} else {
		fmt.Printf("bar not found in %v", sliceOfString)
	}
}
Output:

bar found in [foo bar]

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func EqualStringSlice

func EqualStringSlice(a, b []string) bool

EqualStringSlice check if two slice of string is Equal: same length, same element in same order.

func Int64InSlice

func Int64InSlice(num int64, list []int64) bool

Int64InSlice check if int64 is present in slice of int64.

func IntInSlice

func IntInSlice(num int, list []int) bool

IntInSlice check if int is present in slice of int.

func StringHasOneOfPrefixes added in v0.2.0

func StringHasOneOfPrefixes(s string, list []string) bool

StringHasOneOfPrefixes check if string has one of prefix list.

func StringInSlice

func StringInSlice(str string, list []string) bool

StringInSlice check if string is present in slice of string.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL