title: convert string to fixed size byte array in Go
body: <p>Is there convenient way for initial a byte array?</p>
  
  <pre><code>package main
  import "fmt"
  type T1 struct {
    f1 [5]byte  // I use fixed size here for file format or network packet format.
    f2 int32
  }
  func main() {
    t := T1{"abcde", 3}
    // t:= T1{[5]byte{'a','b','c','d','e'}, 3} // work, but ugly
    fmt.Println(t)
  }
  </code></pre>
  
  <p>prog.go:8: cannot use "abcde" (type string) as type [5]uint8 in field value</p>
  
  <p>if I change the line to <code>t := T1{[5]byte("abcde"), 3}</code></p>
  
  <p>prog.go:8: cannot convert "abcde" (type string) to type [5]uint8</p>