added pointer receiver
This commit is contained in:
parent
163f11c397
commit
fb1d8d2647
2 changed files with 6 additions and 6 deletions
|
|
@ -24,9 +24,9 @@ func (c *IPConfigs) Set(index int, ipc *IPConfig) {
|
||||||
(*c)[index] = ipc
|
(*c)[index] = ipc
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c IPConfigs) Get(index int) *IPConfig {
|
func (c *IPConfigs) Get(index int) *IPConfig {
|
||||||
if len(c)-1 >= index {
|
if len(*c)-1 >= index {
|
||||||
return c[index]
|
return (*c)[index]
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -25,9 +25,9 @@ func (c *NetworkDevices) Set(index int, d *NetworkDevice) {
|
||||||
(*c)[index] = d
|
(*c)[index] = d
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c NetworkDevices) Get(index int) *NetworkDevice {
|
func (c *NetworkDevices) Get(index int) *NetworkDevice {
|
||||||
if len(c)-1 >= index {
|
if len(*c)-1 >= index {
|
||||||
return c[index]
|
return (*c)[index]
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue