Skip to content

Useful slices operations in Golang

Published: at 05:55 AM

Table of contents

Open Table of contents

Create a slice

package main

func main() {
    studentSlice := []string{}
    var studentSlice []string{}
}

Add item to a slice

Remote or delete item from a slice

Getting items from slices

Length of a Slice

Iterating through slices

Concatenating slices together