mirror of
https://github.com/onyx-and-iris/xair-cli.git
synced 2026-02-04 07:27:47 +00:00
pass pointers to factory methods
This commit is contained in:
parent
89ab8ee258
commit
72f43452a8
@ -58,10 +58,10 @@ func NewClient(mixerIP string, mixerPort int, opts ...Option) (*Client, error) {
|
|||||||
c := &Client{
|
c := &Client{
|
||||||
engine: *e,
|
engine: *e,
|
||||||
}
|
}
|
||||||
c.Main = newMain(*c)
|
c.Main = newMain(c)
|
||||||
c.Strip = NewStrip(*c)
|
c.Strip = NewStrip(c)
|
||||||
c.Bus = NewBus(*c)
|
c.Bus = NewBus(c)
|
||||||
c.HeadAmp = NewHeadAmp(*c)
|
c.HeadAmp = NewHeadAmp(c)
|
||||||
|
|
||||||
return c, nil
|
return c, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@ -4,10 +4,10 @@ import "fmt"
|
|||||||
|
|
||||||
type HeadAmp struct {
|
type HeadAmp struct {
|
||||||
baseAddress string
|
baseAddress string
|
||||||
client Client
|
client *Client
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewHeadAmp(c Client) *HeadAmp {
|
func NewHeadAmp(c *Client) *HeadAmp {
|
||||||
return &HeadAmp{
|
return &HeadAmp{
|
||||||
baseAddress: c.addressMap["headamp"],
|
baseAddress: c.addressMap["headamp"],
|
||||||
client: c,
|
client: c,
|
||||||
|
|||||||
@ -3,10 +3,10 @@ package xair
|
|||||||
import "fmt"
|
import "fmt"
|
||||||
|
|
||||||
type Main struct {
|
type Main struct {
|
||||||
client Client
|
client *Client
|
||||||
}
|
}
|
||||||
|
|
||||||
func newMain(c Client) *Main {
|
func newMain(c *Client) *Main {
|
||||||
return &Main{
|
return &Main{
|
||||||
client: c,
|
client: c,
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user