-
Notifications
You must be signed in to change notification settings - Fork 13
"(*bufferChecker).DataInt16" considered an exported/public method #63
Comments
Hmm, this is pretty subtle and depends on the exact definitions. As far as I see, it is an exported method, but the type it's associated with is not exported. If an exported func returns this unexported type, then its exported methods can be accessed, but its unexported methods cannot be: package foo
func ExportedFuncThatReturnsUnexportedBufferChecker() *bufferChecker { ... } package bar
import "foo"
func main() {
bc := ExportedFuncThatReturnsUnexportedBufferChecker()
bc.DataInt16() // Ok.
} |
In what way does godoc consider it not to be exported? Can you elaborate? |
For example, https://godoc.org/github.com/slimsag/gfx/debug - This page shows only two exported functions:
However, the data from srclib-go for
The question here is: should |
I see. Seen from that light, I think I'd expect So I'm inclined to think current behavior is not correct. |
srclib-go seems to define
(*bufferChecker).DataInt16
as an exported/public method. I'm not exactly sure whether or not this is the case or not (e.g.reflect
package does consider this to be true, but godoc does not). Is this the correct behavior?The text was updated successfully, but these errors were encountered: