Hello, my issue is similar to:
In this particular case, it is fixed by exporting the fields capitalizing the field name. But, what if the struct fields are also anonymous?
main.go:
----------------------------------------------------
package main
import "a/b"
func f(s struct{ byte }) {}
func main() {
s := struct{ byte }{}
f(s) // This works
b.F(s) // This gives an argument type error
}
----------------------------------------------------
b/b.go:
----------------------------------------------------
package b
func F(c struct{ byte }) {
}
----------------------------------------------------
By building this code, we get the following compiler error:
`cannot use s (type struct { byte }) as type struct { byte } in argument to b.F`
In my opinion, it should be allowed to export the unnamed (anonymous) types so the struct can be used anywhere else. Opinions on this?