InvalidUnsafeAdd occurs when unsafe.Add is called with a length argument that is not of integer type. It also occurs if it is used in a package compiled for a language version before go1.17. Example: import "unsafe" var p unsafe.Pointer var _ = unsafe.Add(p, float64(1))