go/types: fix race-y initialization of Struct.offsets
Use sync.Once to ensure, that 'offsets' field is initialized once only in a threadsafe way. Fixes #12887 Change-Id: I90ef929c421ccd3094339c67a39b02d8f2e47211 Reviewed-on: https://go-review.googlesource.com/16013Reviewed-by: Robert Griesemer <gri@golang.org>
Showing
Please register or sign in to comment