I am new to go programming. Here is my piece of code. I am trying to assign value to a struct and assigning that struct to go channel. But it is not setting it and going to default case.
package main
import (
"fmt"
)
type object struct {
a int
b string
}
func main() {
o1 := object{
a: 25,
b: "quack",
}
var oc chan object
select {
case oc <- o1:
fmt.Println("Chan is set")
default:
fmt.Println("Chan is not set")
}
}