From eeeb88a667141380b843d92eb4478553b2256f17 Mon Sep 17 00:00:00 2001 From: Paul Holzinger Date: Mon, 16 May 2022 14:30:45 +0200 Subject: shell completion --format: only show exported fields go templates only support exported fields, so the completion logic must filter the private fields out. Signed-off-by: Paul Holzinger --- cmd/podman/common/completion_test.go | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'cmd/podman/common/completion_test.go') diff --git a/cmd/podman/common/completion_test.go b/cmd/podman/common/completion_test.go index 13f45a662..c9e189961 100644 --- a/cmd/podman/common/completion_test.go +++ b/cmd/podman/common/completion_test.go @@ -31,6 +31,12 @@ func (c *Car) Color() string { return "" } +// This is for reflect testing required. +// nolint:unused +func (c Car) internal() int { + return 0 +} + func TestAutocompleteFormat(t *testing.T) { testStruct := struct { Name string @@ -38,6 +44,7 @@ func TestAutocompleteFormat(t *testing.T) { Car *Car Car2 *Car *Anonymous + private int }{} testStruct.Car = &Car{} -- cgit v1.2.3-54-g00ecf