2948 explained code solutions for 75 technologies

golangHow to delete item from slice

package main

import "fmt"

func main() {
	s := []int{1,2,3}
	s = append(s[:1], s[2:]...)
}ctrl + c
s := []int{1,2,3}

declare slice of int with 3 sample elements


we'll use append to concatenate parts of given slices without removed element


get part of s slice up to second element (1 position - second element)


get part of s slice from third element up to the end (2 position - third element)