-
Notifications
You must be signed in to change notification settings - Fork 160
Closed
Description
When I run the following short script with Go 1.17 it prints a PANIC=Format method
message
package main
import (
"github.com/kr/pretty"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
func main() {
o := corev1.Secret{
ObjectMeta: metav1.ObjectMeta{
Name: "foo",
},
}
pretty.Println(o)
}
$ go1.16.1 run ./
v1.Secret{
TypeMeta: v1.TypeMeta{},
ObjectMeta: v1.ObjectMeta{
Name: "foo",
GenerateName: "",
Namespace: "",
SelfLink: "",
UID: "",
ResourceVersion: "",
Generation: 0,
CreationTimestamp: v1.Time{},
DeletionTimestamp: (*v1.Time)(nil),
DeletionGracePeriodSeconds: (*int64)(nil),
Labels: {},
Annotations: {},
OwnerReferences: nil,
Finalizers: nil,
ClusterName: "",
ManagedFields: nil,
},
Immutable: (*bool)(nil),
Data: {},
StringData: {},
Type: "",
}
$ go1.17 run ./
v1.Secret{
%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference)
christophcemper and drinktee
Metadata
Metadata
Assignees
Labels
No labels