From fb1d8d26473723bfd09283b76e816bf1716f4c99 Mon Sep 17 00:00:00 2001 From: ston1th Date: Mon, 1 Jun 2020 16:37:50 +0200 Subject: [PATCH] added pointer receiver --- ipconfig.go | 6 +++--- network.go | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ipconfig.go b/ipconfig.go index 6459faf..6e77195 100644 --- a/ipconfig.go +++ b/ipconfig.go @@ -24,9 +24,9 @@ func (c *IPConfigs) Set(index int, ipc *IPConfig) { (*c)[index] = ipc } -func (c IPConfigs) Get(index int) *IPConfig { - if len(c)-1 >= index { - return c[index] +func (c *IPConfigs) Get(index int) *IPConfig { + if len(*c)-1 >= index { + return (*c)[index] } return nil } diff --git a/network.go b/network.go index 1ec084c..0828578 100644 --- a/network.go +++ b/network.go @@ -25,9 +25,9 @@ func (c *NetworkDevices) Set(index int, d *NetworkDevice) { (*c)[index] = d } -func (c NetworkDevices) Get(index int) *NetworkDevice { - if len(c)-1 >= index { - return c[index] +func (c *NetworkDevices) Get(index int) *NetworkDevice { + if len(*c)-1 >= index { + return (*c)[index] } return nil }