How to define slice of numbers in Go

1 Answer

0 votes
package main

import (
    "fmt"
)

func main() {
    slice := []byte{103, 111, 32, 97, 98, 99}

    fmt.Println(slice)
    
    fmt.Println(slice[0])
}



/*
run:

[103 111 32 97 98 99]
103

*/

 



answered Oct 17, 2020 by avibootz

Related questions

...