I recently began to study, and then through a textbook . In the tutorial there is a line:
p1 := &Page{Title: "TestPage", Body: []byte("This is a sample Page.")}
They have a slice with a given bracket:
[]byte("This is a sample Page.")
However, from all the documents that I read, I did not see parentheses after the fragment. I saw only the format:
b := []byte{'g', 'o', 'l', 'a', 'n', 'g'}
Using curly braces. What is the role of parentheses?
source
share