golang get last items of array code example Example: golang get last element of slice sl = sl[:len(sl)-1]