From 32db7bda15b60c50286614ccbe38c5c9e452b991 Mon Sep 17 00:00:00 2001 From: Philippe Martin Date: Wed, 31 Jan 2024 15:55:57 +0100 Subject: [PATCH] Support EXPOSE map[80/tcp:{}] notation --- pkg/command/expose.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pkg/command/expose.go b/pkg/command/expose.go index 7b40d8e..b8d86f0 100644 --- a/pkg/command/expose.go +++ b/pkg/command/expose.go @@ -29,9 +29,12 @@ var exposeResultKey exposeResultKeyType func (e Expose) Analyze(ctx context.Context, node *parser.Node, source utils.Source, line Line) context.Context { str := node.Value - index := strings.IndexByte(node.Value, '/') + if strings.HasPrefix(str, "map[") && strings.HasSuffix(str, "]") { + str = str[4 : len(str)-1] + } + index := strings.IndexByte(str, '/') if index >= 0 { - str = node.Value[0:index] + str = str[0:index] } var results []Result port, err := strconv.Atoi(str)