Skip to content

Commit 69397f3

Browse files
committed
Made CoreInstance private
1 parent ef70257 commit 69397f3

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

Diff for: commands/internal/instances/instances.go

+7-7
Original file line numberDiff line numberDiff line change
@@ -14,38 +14,38 @@ import (
1414

1515
var tr = i18n.Tr
1616

17-
// CoreInstance is an instance of the Arduino Core Services. The user can
17+
// coreInstance is an instance of the Arduino Core Services. The user can
1818
// instantiate as many as needed by providing a different configuration
1919
// for each one.
20-
type CoreInstance struct {
20+
type coreInstance struct {
2121
pm *packagemanager.PackageManager
2222
lm *librariesmanager.LibrariesManager
2323
}
2424

2525
// coreInstancesContainer has methods to add an remove instances atomically.
2626
type coreInstancesContainer struct {
27-
instances map[int32]*CoreInstance
27+
instances map[int32]*coreInstance
2828
instancesCount int32
2929
instancesMux sync.Mutex
3030
}
3131

3232
// instances contains all the running Arduino Core Services instances
3333
var instances = &coreInstancesContainer{
34-
instances: map[int32]*CoreInstance{},
34+
instances: map[int32]*coreInstance{},
3535
instancesCount: 1,
3636
}
3737

3838
// GetInstance returns a CoreInstance for the given ID, or nil if ID
3939
// doesn't exist
40-
func (c *coreInstancesContainer) GetInstance(id int32) *CoreInstance {
40+
func (c *coreInstancesContainer) GetInstance(id int32) *coreInstance {
4141
c.instancesMux.Lock()
4242
defer c.instancesMux.Unlock()
4343
return c.instances[id]
4444
}
4545

4646
// AddAndAssignID saves the CoreInstance and assigns a unique ID to
4747
// retrieve it later
48-
func (c *coreInstancesContainer) AddAndAssignID(i *CoreInstance) int32 {
48+
func (c *coreInstancesContainer) AddAndAssignID(i *coreInstance) int32 {
4949
c.instancesMux.Lock()
5050
defer c.instancesMux.Unlock()
5151
id := c.instancesCount
@@ -110,7 +110,7 @@ func SetLibraryManager(inst *rpc.Instance, lm *librariesmanager.LibrariesManager
110110

111111
// Create a new *rpc.Instance ready to be initialized, supporting directories are also created.
112112
func Create(extraUserAgent ...string) (*rpc.Instance, error) {
113-
instance := &CoreInstance{}
113+
instance := &coreInstance{}
114114

115115
// Setup downloads directory
116116
downloadsDir := configuration.DownloadsDir(configuration.Settings)

0 commit comments

Comments
 (0)