2948 explained code solutions for 75 technologies


golangHow to create slice


package main
 
func main() {
  arr := [2]string{"a","b"}
  print(arr[1])
}ctrl + c
package main

default package declaration

func main() {

declare main function that will be launched automatically

[2]string{

create slice of 2 elements of string type