Unhandled error reported for embeded anonymous field methods

Completed

Given the following code:

var sb strings.Builder
sb.WriteString("Hello, ")
sb.WriteString("World!")

I get no warnings.

However the following will:

type MyBuilder struct {
strings.Builder
}

var mb mytypes.MyBuilder
mb.WriteString("Hello, ")
mb.WriteString("World!")

I get two "Unhandled error" warnings for the two "mb.WriteString" calls.

Is this the expected behavior? WriteString always returns nil for error.

2 comments
Comment actions Permalink
Official comment

Hello,

Thank you for your attention to it.

I've filled out a new ticket on our tracker. Feel free to follow GO-11815.

Comment actions Permalink

It's so awesome that an issue report is made into a ticket by a team member. Mind blown. Thank and I will keep an eye on it.

Again thank you!

2

Please sign in to leave a comment.