From 3a210984eba0716a88ab7eb22ecd1ea4e036def7 Mon Sep 17 00:00:00 2001 From: Melora Hugues Date: Mon, 18 Sep 2023 14:07:03 +0200 Subject: [PATCH] make device node list public --- base.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/base.go b/base.go index b384634..89e67b9 100644 --- a/base.go +++ b/base.go @@ -48,24 +48,24 @@ type DevicePathNode interface { var ErrPathComplete = errors.New("device path already complete") type DevicePath struct { - nodes []DevicePathNode + Nodes []DevicePathNode } func (dp *DevicePath) complete() bool { - return len(dp.nodes) > 0 && dp.nodes[len(dp.nodes)-1].Type() == EndOfHardwareDevicePath + return len(dp.Nodes) > 0 && dp.Nodes[len(dp.Nodes)-1].Type() == EndOfHardwareDevicePath } func (dp *DevicePath) PushNode(node DevicePathNode) error { if dp.complete() { return ErrPathComplete } - dp.nodes = append(dp.nodes, node) + dp.Nodes = append(dp.Nodes, node) return nil } func (dp *DevicePath) String() string { var res []string - for _, node := range dp.nodes { + for _, node := range dp.Nodes { if node.String() != "" { res = append(res, node.String()) }