Skip to content

Commit 7227db7

Browse files
committed
fix: correct field names in ParsePortSpec error messages
Signed-off-by: Hayato Kiwata <dev@haytok.jp>
1 parent 9319806 commit 7227db7

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

pkg/port/portutil/portutil.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ func ParsePortSpec(portSpec string) (*port.Spec, error) {
9494
return nil, fmt.Errorf("unexpected ParentIP in PortSpec string: %q", portSpec)
9595
}
9696
if parts[childIP] != "" && net.ParseIP(parts[childIP]) == nil {
97-
return nil, fmt.Errorf("unexpected ParentIP in PortSpec string: %q", portSpec)
97+
return nil, fmt.Errorf("unexpected ChildIP in PortSpec string: %q", portSpec)
9898
}
9999

100100
ps := &port.Spec{
@@ -105,12 +105,12 @@ func ParsePortSpec(portSpec string) (*port.Spec, error) {
105105

106106
ps.ParentPort, err = strconv.Atoi(parts[parentPort])
107107
if err != nil {
108-
return nil, fmt.Errorf("unexpected ChildPort in PortSpec string: %q: %w", portSpec, err)
108+
return nil, fmt.Errorf("unexpected ParentPort in PortSpec string: %q: %w", portSpec, err)
109109
}
110110

111111
ps.ChildPort, err = strconv.Atoi(parts[childPort])
112112
if err != nil {
113-
return nil, fmt.Errorf("unexpected ParentPort in PortSpec string: %q: %w", portSpec, err)
113+
return nil, fmt.Errorf("unexpected ChildPort in PortSpec string: %q: %w", portSpec, err)
114114
}
115115

116116
return ps, nil

0 commit comments

Comments
 (0)