Which of the following statements creates a buffered channel?
Given the following Go code fragment: type Test interface{ t…
Given the following Go code fragment: type Test interface{ test()} Which of the following is the definition of an interface that embeds another interface?
Filling the blanks in the Go code block below so that it pro…
Filling the blanks in the Go code block below so that it produces the given expected output: var price int =10fmt.Println(“Price is $”, price)var taxRate float64 = 0.08var tax float64 = fmt.Println(“Tax is $”, tax)var total float64 = fmt.Println(“Total cost is $”, total)var availableFund int =120fmt.Println(availableFund, “dollars available.”)fmt.Println(“Within budget?”, ) Expected output: Price is $ 10 Tax is $ 0.8 Total cost is $ 10.8 120 dollars available. Within budget? true
Assume that variable s has been declared as a slice of integ…
Assume that variable s has been declared as a slice of integers. Which of the following is a Go statement that adds two integers 10 and 20 to the slice s?
When you have a value of an interface type,
When you have a value of an interface type,
All of the following is a difference between Go’s switch sta…
All of the following is a difference between Go’s switch statement and the switch statement in C/C++ and Java EXCEPT:
Given the following function signature and function definiti…
Given the following function signature and function definition: func calculate(x int) int func test() { ch := make(chan int) go func() { ch
Assume that variable s has been declared as a string variabl…
Assume that variable s has been declared as a string variable and initialized to a non-empty string literal. Which of the following statement will cause a syntax error? a := s //statement As = ‘B’ //statement B
Which is a valid function in Go that returns the results of…
Which is a valid function in Go that returns the results of swapping two integers?
What is the output of the following Go code block? letter…
What is the output of the following Go code block? letters := string{“Aa”, “Bb”, “Cc”, “Dd”, “Ee”} s1 := letters fmt.Println(s1)