insert

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2018 License: BSL-1.0 Imports: 1 Imported by: 0

README

Insert Package

GoDoc report card

About

This package provides the function "insert" for slices of basic types. It is published on https://github.com/vbsw/insert.

Copyright 2018, Vitali Baumtrok (vbsw@mailbox.org).

Insert Package is distributed under the Boost Software License, version 1.0. (See accompanying file LICENSE or copy at http://www.boost.org/LICENSE_1_0.txt)

Insert Package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Boost Software License for more details.

Example

Source Code:

package main

import (
	"fmt"
	"github.com/vbsw/insert"
)

func main() {
	names := []String{"Alice","Claire","Dave"}
	names = insert.String(names,1,"Bob")

	fmt.Println(names)
}

Output:

[Alice Bob Claire Dave]

References

Documentation

Overview

Package insert provides the "insert" function for slices of basic types.

Version 1.0.0.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bool

func Bool(list []bool, index int, key bool) []bool

Bool inserts key in list.

func Byte

func Byte(list []byte, index int, key byte) []byte

Byte inserts key in list.

func Complex128

func Complex128(list []complex128, index int, key complex128) []complex128

Complex128 inserts key in list.

func Complex64

func Complex64(list []complex64, index int, key complex64) []complex64

Complex64 inserts key in list.

func Error

func Error(list []error, index int, key error) []error

Error inserts key in list.

func Float32

func Float32(list []float32, index int, key float32) []float32

Float32 inserts key in list.

func Float64

func Float64(list []float64, index int, key float64) []float64

Float64 inserts key in list.

func Int

func Int(list []int, index int, key int) []int

Int inserts key in list.

func Int16

func Int16(list []int16, index int, key int16) []int16

Int16 inserts key in list.

func Int32

func Int32(list []int32, index int, key int32) []int32

Int32 inserts key in list.

func Int64

func Int64(list []int64, index int, key int64) []int64

Int64 inserts key in list.

func Int8

func Int8(list []int8, index int, key int8) []int8

Int8 inserts key in list.

func Interface

func Interface(list []interface{}, index int, key interface{}) []interface{}

Interface inserts key in list.

func Pointer

func Pointer(list []unsafe.Pointer, index int, key unsafe.Pointer) []unsafe.Pointer

Pointer inserts key in list.

func Rune

func Rune(list []rune, index int, key rune) []rune

Rune inserts key in list.

func String

func String(list []string, index int, key string) []string

String inserts key in list.

func UInt

func UInt(list []uint, index int, key uint) []uint

UInt inserts key in list.

func UInt16

func UInt16(list []uint16, index int, key uint16) []uint16

UInt16 inserts key in list.

func UInt32

func UInt32(list []uint32, index int, key uint32) []uint32

UInt32 inserts key in list.

func UInt64

func UInt64(list []uint64, index int, key uint64) []uint64

UInt64 inserts key in list.

func UInt8

func UInt8(list []uint8, index int, key uint8) []uint8

UInt8 inserts key in list.

Types

This section is empty.

Jump to

Keyboard shortcuts

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