Code Review
/
src
/
xds
/
xds-server.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Use xds-common go library.
[src/xds/xds-server.git]
/
lib
/
crosssdk
/
sdks.go
diff --git
a/lib/crosssdk/sdks.go
b/lib/crosssdk/sdks.go
index
87bb85d
..
35a9998
100644
(file)
--- a/
lib/crosssdk/sdks.go
+++ b/
lib/crosssdk/sdks.go
@@
-6,7
+6,7
@@
import (
"sync"
"github.com/Sirupsen/logrus"
"sync"
"github.com/Sirupsen/logrus"
-
"github.com/iotbzh/xds-server/lib/common
"
+
common "github.com/iotbzh/xds-common/golib
"
"github.com/iotbzh/xds-server/lib/xdsconfig"
)
"github.com/iotbzh/xds-server/lib/xdsconfig"
)
@@
-39,6
+39,7
@@
func Init(cfg *xdsconfig.Config, log *logrus.Logger) (*SDKs, error) {
sdk, err := NewCrossSDK(d)
if err != nil {
log.Debugf("Error while processing SDK dir=%s, err=%s", d, err.Error())
sdk, err := NewCrossSDK(d)
if err != nil {
log.Debugf("Error while processing SDK dir=%s, err=%s", d, err.Error())
+ continue
}
s.Sdks = append(s.Sdks, *sdk)
}
}
s.Sdks = append(s.Sdks, *sdk)
}
@@
-70,15
+71,15
@@
func (s *SDKs) Get(id int) SDK {
}
// GetEnvCmd returns the command used to initialized the environment for an SDK
}
// GetEnvCmd returns the command used to initialized the environment for an SDK
-func (s *SDKs) GetEnvCmd(id string, defaultID string) string {
+func (s *SDKs) GetEnvCmd(id string, defaultID string)
[]
string {
if id == "" && defaultID == "" {
// no env cmd
if id == "" && defaultID == "" {
// no env cmd
- return
""
+ return
[]string{}
}
s.mutex.Lock()
defer s.mutex.Unlock()
}
s.mutex.Lock()
defer s.mutex.Unlock()
- defaultEnv :=
""
+ defaultEnv :=
[]string{}
for _, sdk := range s.Sdks {
if sdk.ID == id {
return sdk.GetEnvCmd()
for _, sdk := range s.Sdks {
if sdk.ID == id {
return sdk.GetEnvCmd()