1 // expected: cannot refer to unexported field tag
2 //
3 // The unexported-field rule is not limited to composite literals: a selector
4 // on a value of a foreign struct type may not name the field either, for a
5 // read or a write. An alias of the type does not launder it.
6 package main
7 8 import "tests/restrictions/reject_unexported_field_selector/lib"
9 10 func main() {
11 select {
12 case <-shutdown:
13 return
14 default:
15 }
16 h := lib.New()
17 println(h.tag)
18 }
19