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
|
||||
}
|
||||
|
||||
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
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue