Assume that variable ch is a channel whose elements have typ…

Assume that variable ch is a channel whose elements have type int, and variable strs is a slice of string. Which of the following code fragments correctly print out all elements of strs concurrently? (assume that each of these code fragments is placed in the same main function as variable ch and variable strs)

What is the output of the following program? package mainimp…

What is the output of the following program? package mainimport “fmt”import “time”func doSomething(s string) {    fmt.Println(s)}func main() {    go doSomething(“test 1”)    go doSomething(“test 2”)    fmt.Println(“main”)    time.Sleep(100 * time.Millisecond)}

Given the following Go code fragment: type Point struct {   …

Given the following Go code fragment: type Point struct {    X, Y float64} Write a code fragment that makes the Point struct implement  the built-in interface fmt.Stringer, assuming that the standard package fmt has been imported in the same package containing the given code fragment and your code fragment. The implementation must be done so that when calling fmt.Println to print an instance of Point, it will be printed in the following format: (X, Y)

Given the following Go program: package mainimport “fmt”type…

Given the following Go program: package mainimport “fmt”type T struct { S string }func (t *T) test(){ if t==nil { fmt.Println(“nil underlying value”) } else { fmt.Println(t.S)   }}type Test interface{ test()}var myTest Testfunc main(){ var t *T myTest = t myTest.test()} Which of the following statements is true about the given program?