mirror of
https://github.com/wavetermdev/backup.git
synced 2026-08-05 13:57:07 -07:00
allow nil for display
This commit is contained in:
@@ -589,6 +589,9 @@ type PacketType interface {
|
||||
}
|
||||
|
||||
func AsString(pk PacketType) string {
|
||||
if pk == nil {
|
||||
return "nil"
|
||||
}
|
||||
if s, ok := pk.(fmt.Stringer); ok {
|
||||
return s.String()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user