blob: 90e26e037d11464825b24389ec36a987de1908c8 [file] [view]
---
title: InvalidPtrEmbed
layout: article
---
<!-- Copyright 2023 The Go Authors. All rights reserved.
Use of this source code is governed by a BSD-style
license that can be found in the LICENSE file. -->
<!-- Code generated by generrordocs.go; DO NOT EDIT. -->
```
InvalidPtrEmbed occurs when an embedded field is of the pointer form *T,
and T itself is itself a pointer, an unsafe.Pointer, or an interface.
Per the spec:
"An embedded field must be specified as a type name T or as a pointer to
a non-interface type name *T, and T itself may not be a pointer type."
Example:
type T *int
type S struct {
*T
}
```