Commit 914f86a8 authored by Yann Garcia's avatar Yann Garcia
Browse files

Updates to pass linting

parent 47c3aeab
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -303,7 +303,7 @@ func startRefreshTicker() {
	sbi.refreshTicker = time.NewTicker(1000 * time.Millisecond)
	go func() {
		for range sbi.refreshTicker.C {
			refreshAppList()
			_ = refreshAppList()
		}
	}()
}
@@ -411,7 +411,7 @@ func GetApplicationListAppList(appNames []string) (appListSbi *map[string]*meepd
		return appListSbi, nil
	}

	filteredAppListSbi := make(map[string]*meepdaimgr.AppInfoList, 0)
	filteredAppListSbi := make(map[string]*meepdaimgr.AppInfoList)
	for _, appName := range appNames {
		// Remove quotes
		if appName != "" {
+5 −2
Original line number Diff line number Diff line
@@ -622,7 +622,7 @@ func meAppListGET(w http.ResponseWriter, r *http.Request) {
func devAppContextsPOST(w http.ResponseWriter, r *http.Request) {
	log.Info(">>> devAppContextsPOST: ", r)

	// Retrive the AppContext message bosy
	// Retrieve the AppContext message bosy
	var appContext AppContext
	bodyBytes, _ := ioutil.ReadAll(r.Body)
	err := json.Unmarshal(bodyBytes, &appContext)
@@ -637,6 +637,7 @@ func devAppContextsPOST(w http.ResponseWriter, r *http.Request) {
	var appContextSbi meepdaimgr.AppContext
	appContextSbi.AppAutoInstantiation = appContext.AppAutoInstantiation
	if appContext.AppInfo == nil {
		err = errors.New("AppInfo shall be present")
		log.Error(err.Error())
		http.Error(w, err.Error(), http.StatusInternalServerError)
		return
@@ -741,8 +742,9 @@ func devAppContextPUT(w http.ResponseWriter, r *http.Request) {

	// Sanity checks
	if appContext.ContextId != contextId {
		err = errors.New("ContextId mismatch")
		log.Error(err.Error())
		http.Error(w, err.Error(), http.StatusBadRequest)
		http.Error(w, err.Error(), http.StatusInternalServerError)
		return
	}

@@ -750,6 +752,7 @@ func devAppContextPUT(w http.ResponseWriter, r *http.Request) {
	var appContextSbi meepdaimgr.AppContext
	appContextSbi.AppAutoInstantiation = appContext.AppAutoInstantiation
	if appContext.AppInfo == nil {
		err = errors.New("AppInfo shall be present")
		log.Error(err.Error())
		http.Error(w, err.Error(), http.StatusInternalServerError)
		return
+31 −31
Original line number Diff line number Diff line
@@ -494,10 +494,10 @@ const (
	callbackReference2 = "callbackReference2"
	//appLocationUpdates2   = false
	//appAutoInstantiation2 = false
	appName2        = "appName2"
	appProvider2    = "appProvider2"
	appDVersion2    = "appDVersion2"
	appDescription2 = "appDescription2"
	//appName2        = "appName2"
	//appProvider2    = "appProvider2"
	//appDVersion2    = "appDVersion2"
	//appDescription2 = "appDescription2"
)

var ( // Need to take address
@@ -505,11 +505,11 @@ var ( // Need to take address
	appDId1           string = "appDId1"
	appSoftVersion1   string = "appSoftVersion1"
	appPackageSource1 string = "appPackageSource1"
	appInstanceId1_1     string         = "appInstanceId1-1"
	appInstanceId1_2     string         = "appInstanceId1-2"
	appInstanceId1_3     string         = "appInstanceId1-3"
	//appInstanceId1_1     string         = "appInstanceId1-1"
	//appInstanceId1_2     string         = "appInstanceId1-2"
	//appInstanceId1_3     string         = "appInstanceId1-3"
	referenceURI1_1 meepdaimgr.Uri = "referenceURI1-1"
	referenceURI1_3      meepdaimgr.Uri = "referenceURI1-3"
	//referenceURI1_3      meepdaimgr.Uri = "referenceURI1-3"
	area1                       = Polygon{[][][]float32{{{7.420433, 43.729942}, {7.420659, 43.73036}, {7.420621, 43.731045}, {7.420922, 43.73129}}, {{7.420434, 43.729943}, {7.420659, 43.73036}, {7.420621, 43.731045}, {7.420922, 43.73129}}}}
	civicAddressElement1        = []LocationConstraintsCivicAddressElement{{1, "Value1"}, {10, "Value10"}}
	countryCode1         string = "countryCode1"
@@ -520,19 +520,19 @@ var ( // Need to take address
	serviceCont1         int32  = 0

	//contextId2           string = "contextId2"
	appDId2         string = "appDId2"
	appSoftVersion2 string = "appSoftVersion2"
	//appDId2         string = "appDId2"
	//appSoftVersion2 string = "appSoftVersion2"
	//appPackageSource2    string = "appPackageSource2"
	//appInstanceId2_1     string = "appInstanceId2-1"
	//appInstanceId2_2     string = "appInstanceId2-2"
	area2                       = Polygon{[][][]float32{{{7.43166, 43.736156}, {7.431723, 43.736115}, {7.431162, 43.735607}, {7.430685, 43.73518}}}}
	civicAddressElement2        = []LocationConstraintsCivicAddressElement{{2, "Value2"}, {20, "Value20"}}
	countryCode2         string = "countryCode2"
	memory2              int32  = 1024 * 2
	storage2             int32  = 1024 * 2
	latency2             int32  = 1024 * 2
	bandwidth2           int32  = 1024 * 2
	serviceCont2         int32  = 0
	//area2                       = Polygon{[][][]float32{{{7.43166, 43.736156}, {7.431723, 43.736115}, {7.431162, 43.735607}, {7.430685, 43.73518}}}}
	//civicAddressElement2        = []LocationConstraintsCivicAddressElement{{2, "Value2"}, {20, "Value20"}}
	//countryCode2         string = "countryCode2"
	//memory2              int32  = 1024 * 2
	//storage2             int32  = 1024 * 2
	//latency2             int32  = 1024 * 2
	//bandwidth2           int32  = 1024 * 2
	//serviceCont2         int32  = 0
)

func TestNotImplemented(t *testing.T) {
+0 −8
Original line number Diff line number Diff line
@@ -55,9 +55,7 @@ func convertJsonToCivicAddressElement(jsonInfo string) *CivicAddressElement {
}

func NilToEmptyString(s *string) string {
	log.Debug(">>> NilToEmptyString: ", s)
	if s == nil {
		log.Debug(">>> NilToEmptyString: Force to empty", s)
		return ""
	}

@@ -65,9 +63,7 @@ func NilToEmptyString(s *string) string {
}

func EmptyToNilString(s *string) *string {
	log.Debug(">>> EmptyToNilString: ", s)
	if s != nil && *s == "" {
		log.Debug("EmptyToNilString: Force to nil: ", *s)
		return nil
	}

@@ -75,9 +71,7 @@ func EmptyToNilString(s *string) *string {
}

func NilToEmptyUri(s *Uri) Uri {
	log.Debug(">>> NilToEmptyUri: ", s)
	if s == nil {
		log.Debug("NilToEmptyUri: Force to empty", s)
		return ""
	}

@@ -85,9 +79,7 @@ func NilToEmptyUri(s *Uri) Uri {
}

func EmptyToNilUri(s *Uri) *Uri {
	log.Debug(">>> EmptyToNilUri: ", s)
	if s != nil && *s == "" {
		log.Debug("EmptyToNilUri: Force to nil: ", *s)
		return nil
	}

+2 −2

File changed.

Contains only whitespace changes.